You are here

protected function JsonApiDocumentTopLevelNormalizerTest::generateProphecies in JSON:API 8.2

Same name and namespace in other branches
  1. 8 tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php \Drupal\Tests\jsonapi\Kernel\Normalizer\JsonApiDocumentTopLevelNormalizerTest::generateProphecies()

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 tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php
Ensure that cacheability metadata is properly added.
JsonApiDocumentTopLevelNormalizerTest::testDenormalize in tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php
Try to POST a node and check if it exists afterwards.
JsonApiDocumentTopLevelNormalizerTest::testDenormalizeInvalidTypeAndNoType in tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php
Tests denormalization for related resources with missing or invalid types.
JsonApiDocumentTopLevelNormalizerTest::testDenormalizeUuid in tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php
Try to POST a node and check if it exists afterwards.
JsonApiDocumentTopLevelNormalizerTest::testNormalize in tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php
@covers ::normalize

... See full list

File

tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php, line 753

Class

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

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,
  ];
}