+
+ // Test the generateSampleValue() method.
+ $node = Node::create([
+ 'title' => $this->randomString(),
+ 'type' => 'foo',
+ 'path' => ['alias' => '/foo'],
+ ]);
+ $node->save();
+ $path_field = $node->get('path');
+ $path_field->generateSampleItems();
+ $node->save();
+ $this->assertStringStartsWith('/', $node->get('path')->alias);