You are here

public function EntityResourceTest::testGetIndividual in JSON:API 8

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/Controller/EntityResourceTest.php \Drupal\Tests\jsonapi\Kernel\Controller\EntityResourceTest::testGetIndividual()

@covers ::getIndividual

File

tests/src/Kernel/Controller/EntityResourceTest.php, line 164

Class

EntityResourceTest
@coversDefaultClass \Drupal\jsonapi\Controller\EntityResource @group jsonapi @group legacy

Namespace

Drupal\Tests\jsonapi\Kernel\Controller

Code

public function testGetIndividual() {
  $entity_resource = $this
    ->buildEntityResource('node', 'article');
  $response = $entity_resource
    ->getIndividual($this->node, new Request());
  $this
    ->assertInstanceOf(JsonApiDocumentTopLevel::class, $response
    ->getResponseData());
  $this
    ->assertEquals(1, $response
    ->getResponseData()
    ->getData()
    ->id());
}