You are here

public function ExternalNormalizersTest::providerTestFormatAgnosticNormalizers in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/tests/src/Functional/ExternalNormalizersTest.php \Drupal\Tests\jsonapi\Functional\ExternalNormalizersTest::providerTestFormatAgnosticNormalizers()

Data provider.

Return value

array Test cases.

File

core/modules/jsonapi/tests/src/Functional/ExternalNormalizersTest.php, line 185

Class

ExternalNormalizersTest
Asserts external normalizers are handled as expected by the JSON:API module.

Namespace

Drupal\Tests\jsonapi\Functional

Code

public function providerTestFormatAgnosticNormalizers() {
  return [
    'Format-agnostic @FieldType-level normalizers SHOULD NOT be able to affect the JSON:API normalization' => [
      'jsonapi_test_field_type',
      // \Drupal\jsonapi_test_field_type\Normalizer\StringNormalizer::normalize()
      static::VALUE_ORIGINAL,
      // \Drupal\jsonapi_test_field_type\Normalizer\StringNormalizer::denormalize()
      static::VALUE_OVERRIDDEN,
    ],
    'Format-agnostic @DataType-level normalizers SHOULD be able to affect the JSON:API normalization' => [
      'jsonapi_test_data_type',
      // \Drupal\jsonapi_test_data_type\Normalizer\StringNormalizer::normalize()
      static::VALUE_OVERRIDDEN,
      // \Drupal\jsonapi_test_data_type\Normalizer\StringNormalizer::denormalize()
      static::VALUE_ORIGINAL,
    ],
  ];
}