You are here

protected function JsonApiDocumentTopLevelNormalizerTest::generateProphecies in Drupal 8

Generates the prophecies for the mocked entity request.

Parameters

string $entity_type_id: The ID of the entity type. Ex: node.

string $bundle: The bundle. Ex: article.

Return value

array A numeric array containing the request and the ResourceType.

Throws

\Exception

8 calls to JsonApiDocumentTopLevelNormalizerTest::generateProphecies()
JsonApiDocumentTopLevelNormalizerTest::testCacheableMetadata in core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php
Ensure that cacheability metadata is properly added.
JsonApiDocumentTopLevelNormalizerTest::testDenormalize in core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php
Try to POST a node and check if it exists afterwards.
JsonApiDocumentTopLevelNormalizerTest::testDenormalizeInvalidTypeAndNoType in core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php
Tests denormalization for related resources with missing or invalid types.
JsonApiDocumentTopLevelNormalizerTest::testDenormalizeUuid in core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php
Try to POST a node and check if it exists afterwards.
JsonApiDocumentTopLevelNormalizerTest::testNormalize in core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php
@covers ::normalize

... See full list

File

core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php, line 752

Class

JsonApiDocumentTopLevelNormalizerTest
@coversDefaultClass \Drupal\jsonapi\Normalizer\JsonApiDocumentTopLevelNormalizer @group jsonapi

Namespace

Drupal\Tests\jsonapi\Kernel\Normalizer

Code

protected function generateProphecies($entity_type_id, $bundle) {
  $resource_type = $this->container
    ->get('jsonapi.resource_type.repository')
    ->get($entity_type_id, $bundle);
  return [
    new Request(),
    $resource_type,
  ];
}