You are here

public function ContentHubEntityDependencyTest::testSetStatus in Acquia Content Hub 8

Test setStatus method.

@covers ::setStatus

File

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

Class

ContentHubEntityDependencyTest
PHPUnit for the ContentHubEntityDependency class.

Namespace

Drupal\Tests\acquia_contenthub\Unit

Code

public function testSetStatus() {
  $status = 1;
  $this->entity = $this
    ->createContentHubEntity();
  $ch_entity_dependency = new ContentHubEntityDependency($this->entity);
  $ch_entity_dependency
    ->setStatus($status);
  $cdf = $ch_entity_dependency
    ->getRawEntity();
  $expected = [
    'type' => Attribute::TYPE_INTEGER,
    'value' => [
      'en' => $status,
    ],
  ];
  $this
    ->assertEquals($expected, $cdf['attributes']['status']);
}