You are here

public function ModerationStateFieldTest::testModerationStateFieldIsCreated in Workbench Moderation 8

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/ModerationStateFieldTest.php \Drupal\Tests\workbench_moderation\Kernel\ModerationStateFieldTest::testModerationStateFieldIsCreated()

Covers moderation_state_install().

File

tests/src/Kernel/ModerationStateFieldTest.php, line 38

Class

ModerationStateFieldTest
Tests moderation state field.

Namespace

Drupal\Tests\workbench_moderation\Kernel

Code

public function testModerationStateFieldIsCreated() {

  // There should be no updates as moderation_state_install() should have
  // applied the new field.
  $this
    ->assertTrue(empty($this->container
    ->get('entity.definition_update_manager')
    ->needsUpdates()['node']));
  $this
    ->assertTrue(!empty($this->container
    ->get('entity_field.manager')
    ->getFieldStorageDefinitions('node')['moderation_state']));
}