class UuidItemTest in Drupal 10
Same name and namespace in other branches
- 8 core/modules/field/tests/src/Kernel/String/UuidItemTest.php \Drupal\Tests\field\Kernel\String\UuidItemTest
- 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\StringView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
UuidItemTest:: |
public | function | Tests 'uuid' random values. |