You are here

public function UuidTest::providerTestValidation in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Component/Uuid/UuidTest.php \Drupal\Tests\Component\Uuid\UuidTest::providerTestValidation()
  2. 9 core/tests/Drupal/Tests/Component/Uuid/UuidTest.php \Drupal\Tests\Component\Uuid\UuidTest::providerTestValidation()

Data provider for UUID instance tests.

Return value

array An array of arrays containing

  • The Uuid to check against.
  • (bool) Whether or not the Uuid is valid.
  • Failure message.

File

core/tests/Drupal/Tests/Component/Uuid/UuidTest.php, line 85

Class

UuidTest
Tests the handling of Universally Unique Identifiers (UUIDs).

Namespace

Drupal\Tests\Component\Uuid

Code

public function providerTestValidation() {
  return [
    // These valid UUIDs.
    [
      '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
      TRUE,
      'Basic FQDN UUID did not validate',
    ],
    [
      '00000000-0000-0000-0000-000000000000',
      TRUE,
      'Minimum UUID did not validate',
    ],
    [
      'ffffffff-ffff-ffff-ffff-ffffffffffff',
      TRUE,
      'Maximum UUID did not validate',
    ],
    // These are invalid UUIDs.
    [
      '0ab26e6b-f074-4e44-9da-601205fa0e976',
      FALSE,
      'Invalid format was validated',
    ],
    [
      '0ab26e6b-f074-4e44-9daf-1205fa0e9761f',
      FALSE,
      'Invalid length was validated',
    ],
  ];
}