You are here

class UuidItemTest in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/field/tests/src/Kernel/String/UuidItemTest.php \Drupal\Tests\field\Kernel\String\UuidItemTest
  2. 9 core/modules/field/tests/src/Kernel/String/UuidItemTest.php \Drupal\Tests\field\Kernel\String\UuidItemTest

Tests the UUID field.

@group field

Hierarchy

  • class \Drupal\Tests\field\Kernel\String\UuidItemTest extends \Drupal\Tests\field\Kernel\FieldKernelTestBase

Expanded class hierarchy of UuidItemTest

File

core/modules/field/tests/src/Kernel/String/UuidItemTest.php, line 14

Namespace

Drupal\Tests\field\Kernel\String
View source
class UuidItemTest extends FieldKernelTestBase {

  /**
   * Tests 'uuid' random values.
   */
  public function testSampleValue() {
    $entity = EntityTest::create([]);
    $entity
      ->save();
    $uuid_field = $entity
      ->get('uuid');

    // Test the generateSampleValue() method.
    $uuid_field
      ->generateSampleItems();
    $this
      ->assertTrue(Uuid::isValid($uuid_field->value));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
UuidItemTest::testSampleValue public function Tests 'uuid' random values.