public function HierarchyNestedSetIntegrationTest::testDeleteChildWithGrandChildren in Entity Reference Hierarchy 3.x
Same name and namespace in other branches
- 8.2 tests/src/Kernel/HierarchyNestedSetIntegrationTest.php \Drupal\Tests\entity_hierarchy\Kernel\HierarchyNestedSetIntegrationTest::testDeleteChildWithGrandChildren()
Tests deleting child node with grandchildren.
File
- tests/
src/ Kernel/ HierarchyNestedSetIntegrationTest.php, line 124
Class
- HierarchyNestedSetIntegrationTest
- Tests integration with entity_hierarchy.
Namespace
Drupal\Tests\entity_hierarchy\KernelCode
public function testDeleteChildWithGrandChildren() {
$child = $this
->createTestEntity($this->parent
->id());
$grand_child = $this
->createTestEntity($child
->id(), 'Grandchild 1', 1);
$this
->assertSimpleParentChild($child);
$this
->assertSimpleParentChild($grand_child, $child, 1);
$child
->delete();
$this
->assertSimpleParentChild($grand_child, $this->parent);
}