You are here

public function ContentHubEntityDependencyTest::testIsEntityDependent in Acquia Content Hub 8

Test for isEntityDependent() method.

@covers ::isEntityDependent

File

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

Class

ContentHubEntityDependencyTest
PHPUnit for the ContentHubEntityDependency class.

Namespace

Drupal\Tests\acquia_contenthub\Unit

Code

public function testIsEntityDependent() {

  // A 'node' entity is an 'independent' entity.
  $this->entity = $this
    ->createContentHubEntity();
  $ch_entity_dependency = new ContentHubEntityDependency($this->entity);
  $this
    ->assertFalse($ch_entity_dependency
    ->isEntityDependent());

  // A 'paragraph' entity is a 'dependent' entity.
  $values = [
    'type' => 'paragraph',
  ];
  $this->entity = $this
    ->createContentHubEntity($values);
  $ch_entity_dependency = new ContentHubEntityDependency($this->entity);
  $this
    ->assertTrue($ch_entity_dependency
    ->isEntityDependent());
}