You are here

public function JsonApiDocumentTopLevelNormalizerTest::denormalizeUuidProvider in JSON:API 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php \Drupal\Tests\jsonapi\Unit\Normalizer\JsonApiDocumentTopLevelNormalizerTest::denormalizeUuidProvider()

Provides test cases for testDenormalizeUuid.

File

tests/src/Unit/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php, line 247

Class

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

Namespace

Drupal\Tests\jsonapi\Unit\Normalizer

Code

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