Updated to Drupal 8.6.4, which is PHP 7.3 friendly. Also updated HTMLaw library....
[yaffs-website] / web / core / modules / field / tests / src / Kernel / String / UuidItemTest.php
1 <?php
2
3 namespace Drupal\Tests\field\Kernel\String;
4
5 use Drupal\entity_test\Entity\EntityTest;
6 use Drupal\Tests\field\Kernel\FieldKernelTestBase;
7 use Drupal\Component\Uuid\Uuid;
8
9 /**
10  * Tests the UUID field.
11  *
12  * @group field
13  */
14 class UuidItemTest extends FieldKernelTestBase {
15
16   /**
17    * Tests 'uuid' random values.
18    */
19   public function testSampleValue() {
20     $entity = EntityTest::create([]);
21     $entity->save();
22
23     $uuid_field = $entity->get('uuid');
24
25     // Test the generateSampleValue() method.
26     $uuid_field->generateSampleItems();
27     $this->assertTrue(Uuid::isValid($uuid_field->value));
28   }
29
30 }