You are here

public function HierarchyNestedSetIntegrationTest::testNestedSetStorageWithSiblingUpdate in Entity Reference Hierarchy 3.x

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/HierarchyNestedSetIntegrationTest.php \Drupal\Tests\entity_hierarchy\Kernel\HierarchyNestedSetIntegrationTest::testNestedSetStorageWithSiblingUpdate()

Tests saving with existing parent and sibling (no value change).

File

tests/src/Kernel/HierarchyNestedSetIntegrationTest.php, line 163

Class

HierarchyNestedSetIntegrationTest
Tests integration with entity_hierarchy.

Namespace

Drupal\Tests\entity_hierarchy\Kernel

Code

public function testNestedSetStorageWithSiblingUpdate() {
  $child = $this
    ->createTestEntity($this->parent
    ->id(), 'Child 1', 1);
  $sibling = $this
    ->createTestEntity($this->parent
    ->id(), 'Child 2', 2);
  $this
    ->assertParentWithTwoChildren($child, $sibling);
  $child
    ->save();
  $this
    ->assertParentWithTwoChildren($child, $sibling);
}