function UuidTest::testGenerateUuid

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Uuid/UuidTest.php \Drupal\Tests\Component\Uuid\UuidTest::testGenerateUuid()
  2. 8.9.x core/tests/Drupal/Tests/Component/Uuid/UuidTest.php \Drupal\Tests\Component\Uuid\UuidTest::testGenerateUuid()
  3. 11.x core/tests/Drupal/Tests/Component/Uuid/UuidTest.php \Drupal\Tests\Component\Uuid\UuidTest::testGenerateUuid()

Tests generating valid UUIDs.

@dataProvider providerUuidInstances

File

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

Class

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

Namespace

Drupal\Tests\Component\Uuid

Code

public function testGenerateUuid(UuidInterface $instance) : void {
    $this->assertTrue(Uuid::isValid($instance->generate()), sprintf('UUID generation for %s works.', get_class($instance)));
}

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