function ExternalNormalizersTest::providerTestFormatAgnosticNormalizers

Same name and namespace in other branches
  1. 8.9.x core/modules/jsonapi/tests/src/Functional/ExternalNormalizersTest.php \Drupal\Tests\jsonapi\Functional\ExternalNormalizersTest::providerTestFormatAgnosticNormalizers()
  2. 10 core/modules/jsonapi/tests/src/Functional/ExternalNormalizersTest.php \Drupal\Tests\jsonapi\Functional\ExternalNormalizersTest::providerTestFormatAgnosticNormalizers()
  3. 11.x 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,
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.