You are here

public function EntityNormalizerValueTest::testRasterizeValue in JSON:API 8

@covers ::rasterizeValue

File

tests/src/Unit/Normalizer/Value/EntityNormalizerValueTest.php, line 142

Class

EntityNormalizerValueTest
@coversDefaultClass \Drupal\jsonapi\Normalizer\Value\EntityNormalizerValue @group jsonapi

Namespace

Drupal\Tests\jsonapi\Unit\Normalizer\Value

Code

public function testRasterizeValue() {
  $this
    ->assertEquals([
    'type' => 'node--article',
    'id' => '248150b2-79a2-4b44-9f49-bf405a51414a',
    'attributes' => [
      'title' => 'dummy_title',
    ],
    'relationships' => [
      'field_related' => [
        'data' => [
          'type' => 'node',
          'id' => 2,
        ],
      ],
    ],
    'links' => [
      'self' => 'dummy_entity_link',
    ],
  ], $this->object
    ->rasterizeValue());
}