.../modules/path/tests/src/Kernel/PathItemTest.php | 32 ---------------------- 1 file changed, 32 deletions(-) diff --git a/core/modules/path/tests/src/Kernel/PathItemTest.php b/core/modules/path/tests/src/Kernel/PathItemTest.php index 0e2eaf8..fba96de 100644 --- a/core/modules/path/tests/src/Kernel/PathItemTest.php +++ b/core/modules/path/tests/src/Kernel/PathItemTest.php @@ -49,30 +49,14 @@ public function testPathItem() { $node_storage = \Drupal::entityTypeManager()->getStorage('node'); - // Ensure that empty() and count() act the same no matter which order they - // are called in. // First test with an entity that doesn't have the path field set. $node = Node::create([ 'title' => 'Testing no path', 'type' => 'foo', ]); - // Test using count() first. - $this->assertEquals(0, count($node->get('path'))); - $this->assertTrue($node->get('path')->isEmpty()); - - $node->save(); - $this->assertEquals(0, count($node->get('path'))); - $this->assertTrue($node->get('path')->isEmpty()); - - $node = Node::create([ - 'title' => 'Testing no path', - 'type' => 'foo', - ]); - // Test using isEmpty() first. $this->assertTrue($node->get('path')->isEmpty()); $this->assertEquals(0, count($node->get('path'))); - $node->save(); $this->assertTrue($node->get('path')->isEmpty()); $this->assertEquals(0, count($node->get('path'))); @@ -81,24 +65,8 @@ public function testPathItem() { $node = Node::create([ 'title' => 'Testing create()', 'type' => 'foo', - 'path' => ['alias' => '/this-is-not-the-path-you-are-looking-for'], - ]); - // Test using count() first. - $this->assertEquals(1, count($node->get('path'))); - $this->assertFalse($node->get('path')->isEmpty()); - $this->assertEquals('/this-is-not-the-path-you-are-looking-for', $node->get('path')->alias); - - $node->save(); - $this->assertEquals(1, count($node->get('path'))); - $this->assertFalse($node->get('path')->isEmpty()); - $this->assertEquals('/this-is-not-the-path-you-are-looking-for', $node->get('path')->alias); - - $node = Node::create([ - 'title' => 'Testing create()', - 'type' => 'foo', 'path' => ['alias' => '/foo'], ]); - // Test using isEmpty() first. $this->assertFalse($node->get('path')->isEmpty()); $this->assertEquals(1, count($node->get('path'))); $this->assertEquals('/foo', $node->get('path')->alias);