public function JsonApiFunctionalTest::testReferencingTwiceRead in JSON:API 8
Same name and namespace in other branches
- 8.2 tests/src/Functional/JsonApiFunctionalTest.php \Drupal\Tests\jsonapi\Functional\JsonApiFunctionalTest::testReferencingTwiceRead()
Test the GET method on articles referencing the same tag twice.
File
- tests/
src/ Functional/ JsonApiFunctionalTest.php, line 477
Class
- JsonApiFunctionalTest
- General functional test class.
Namespace
Drupal\Tests\jsonapi\FunctionalCode
public function testReferencingTwiceRead() {
$this
->createDefaultContent(1, 1, FALSE, FALSE, static::IS_NOT_MULTILINGUAL, TRUE);
// 1. Load all articles (1st page).
$collection_output = Json::decode($this
->drupalGet('/jsonapi/node/article'));
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertEquals(1, count($collection_output['data']));
$this
->assertSession()
->responseHeaderEquals('Content-Type', 'application/vnd.api+json');
}