You are here

public function ResourceIdentifierNormalizerTest::denormalizeProvider in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/jsonapi/tests/src/Unit/Normalizer/ResourceIdentifierNormalizerTest.php \Drupal\Tests\jsonapi\Unit\Normalizer\ResourceIdentifierNormalizerTest::denormalizeProvider()
  2. 10 core/modules/jsonapi/tests/src/Unit/Normalizer/ResourceIdentifierNormalizerTest.php \Drupal\Tests\jsonapi\Unit\Normalizer\ResourceIdentifierNormalizerTest::denormalizeProvider()

Data provider for the denormalize test.

Return value

array The data for the test method.

File

core/modules/jsonapi/tests/src/Unit/Normalizer/ResourceIdentifierNormalizerTest.php, line 127

Class

ResourceIdentifierNormalizerTest
@coversDefaultClass \Drupal\jsonapi\Normalizer\ResourceIdentifierNormalizer @group jsonapi

Namespace

Drupal\Tests\jsonapi\Unit\Normalizer

Code

public function denormalizeProvider() {
  return [
    [
      [
        'data' => [
          [
            'type' => 'lorem--dummy_bundle',
            'id' => '4e6cb61d-4f04-437f-99fe-42c002393658',
          ],
        ],
      ],
      'field_dummy',
      [
        new ResourceIdentifier('lorem--dummy_bundle', '4e6cb61d-4f04-437f-99fe-42c002393658'),
      ],
    ],
    [
      [
        'data' => [],
      ],
      'field_dummy',
      [],
    ],
    [
      [
        'data' => NULL,
      ],
      'field_dummy_single',
      [],
    ],
  ];
}