protected function EntityToJsonApiTest::assertJsonApi in JSON:API Extras 8.2
Same name and namespace in other branches
- 8.3 tests/src/Kernel/EntityToJsonApiTest.php \Drupal\Tests\jsonapi_extras\Kernel\EntityToJsonApiTest::assertJsonApi()
Helper to assert if a string is valid JSON API.
Parameters
array $structured: The JSON API data to check.
1 call to EntityToJsonApiTest::assertJsonApi()
- EntityToJsonApiTest::assertEntity in tests/
src/ Kernel/ EntityToJsonApiTest.php - Checks entity's serialization/normalization.
File
- tests/
src/ Kernel/ EntityToJsonApiTest.php, line 252
Class
- EntityToJsonApiTest
- @coversDefaultClass \Drupal\jsonapi_extras\EntityToJsonApi @group jsonapi @group jsonapi_serializer @group legacy
Namespace
Drupal\Tests\jsonapi_extras\KernelCode
protected function assertJsonApi(array $structured) {
static::assertNotEmpty($structured['data']['type']);
static::assertNotEmpty($structured['data']['id']);
static::assertNotEmpty($structured['data']['attributes']);
static::assertInternalType('string', $structured['links']['self']);
}