You are here

public function ContentHubEntityDependencyTest::testParenthood in Acquia Content Hub 8

Test Dependency Chain.

@covers ::setParent @covers ::getParent

File

tests/src/Unit/ContentHubEntityDependencyTest.php, line 156

Class

ContentHubEntityDependencyTest
PHPUnit for the ContentHubEntityDependency class.

Namespace

Drupal\Tests\acquia_contenthub\Unit

Code

public function testParenthood() {
  $this->entity = $this
    ->createContentHubEntity();
  $ch_entity_dependency = new ContentHubEntityDependency($this->entity);

  // Adding a parent.
  $entity1 = $this
    ->createContentHubEntity([
    'uuid' => '00000000-2222-0000-0000-000000000000',
  ]);
  $ch_entity_dependency1 = new ContentHubEntityDependency($entity1);
  $ch_entity_dependency
    ->setParent($ch_entity_dependency1);
  $this
    ->assertEquals($ch_entity_dependency1, $ch_entity_dependency
    ->getParent());
}