function JsonApiDocumentTopLevelNormalizerTest::denormalizeUuidProvider

Same name in other branches
  1. 9 core/modules/jsonapi/tests/src/Unit/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php \Drupal\Tests\jsonapi\Unit\Normalizer\JsonApiDocumentTopLevelNormalizerTest::denormalizeUuidProvider()
  2. 8.9.x core/modules/jsonapi/tests/src/Unit/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php \Drupal\Tests\jsonapi\Unit\Normalizer\JsonApiDocumentTopLevelNormalizerTest::denormalizeUuidProvider()
  3. 10 core/modules/jsonapi/tests/src/Unit/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php \Drupal\Tests\jsonapi\Unit\Normalizer\JsonApiDocumentTopLevelNormalizerTest::denormalizeUuidProvider()

Provides test cases for testDenormalizeUuid.

File

core/modules/jsonapi/tests/src/Unit/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php, line 243

Class

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

Namespace

Drupal\Tests\jsonapi\Unit\Normalizer

Code

public static function denormalizeUuidProvider() {
    return [
        'valid' => [
            '76dd5c18-ea1b-4150-9e75-b21958a2b836',
            FALSE,
        ],
        'missing' => [
            NULL,
            FALSE,
        ],
        'invalid_empty' => [
            '',
            TRUE,
        ],
        'invalid_alpha' => [
            'invalid',
            TRUE,
        ],
        'invalid_numeric' => [
            1234,
            TRUE,
        ],
        'invalid_alphanumeric' => [
            'abc123',
            TRUE,
        ],
    ];
}

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