X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fpathauto%2Ftests%2Fsrc%2FKernel%2FPathautoKernelTest.php;fp=web%2Fmodules%2Fcontrib%2Fpathauto%2Ftests%2Fsrc%2FKernel%2FPathautoKernelTest.php;h=1d5db68b2f505df7d5ba67b62310f79b70a7658b;hp=b69d4373c956f602c92fa9aa353908f7b4b6a91e;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/web/modules/contrib/pathauto/tests/src/Kernel/PathautoKernelTest.php b/web/modules/contrib/pathauto/tests/src/Kernel/PathautoKernelTest.php index b69d4373c..1d5db68b2 100644 --- a/web/modules/contrib/pathauto/tests/src/Kernel/PathautoKernelTest.php +++ b/web/modules/contrib/pathauto/tests/src/Kernel/PathautoKernelTest.php @@ -547,6 +547,22 @@ class PathautoKernelTest extends KernelTestBase { $this->assertEntityAlias($node1, '/content/default-revision'); } + /** + * Tests that the pathauto state property gets set to CREATED for new nodes. + * + * In some cases, this can trigger $node->path to be set up with no default + * value for the pathauto property. + */ + public function testCreateNodeWhileAccessingPath() { + $node = Node::create([ + 'type' => 'article', + 'title' => 'TestAlias', + ]); + $node->path->langcode; + $node->save(); + $this->assertEntityAlias($node, '/content/testalias'); + } + /** * Creates a node programmatically. *