function ModerationInformationTest::testGetOriginalState

Same name in other branches
  1. 9 core/modules/content_moderation/tests/src/Kernel/ModerationInformationTest.php \Drupal\Tests\content_moderation\Kernel\ModerationInformationTest::testGetOriginalState()
  2. 8.9.x core/modules/content_moderation/tests/src/Kernel/ModerationInformationTest.php \Drupal\Tests\content_moderation\Kernel\ModerationInformationTest::testGetOriginalState()
  3. 11.x core/modules/content_moderation/tests/src/Kernel/ModerationInformationTest.php \Drupal\Tests\content_moderation\Kernel\ModerationInformationTest::testGetOriginalState()

@covers ::getOriginalState

File

core/modules/content_moderation/tests/src/Kernel/ModerationInformationTest.php, line 187

Class

ModerationInformationTest
@coversDefaultClass \Drupal\content_moderation\ModerationInformation @group content_moderation

Namespace

Drupal\Tests\content_moderation\Kernel

Code

public function testGetOriginalState() : void {
    $entity = EntityTestMulRevPub::create([
        'moderation_state' => 'published',
    ]);
    $entity->save();
    $entity->moderation_state = 'foo';
    $this->assertEquals('published', $this->moderationInformation
        ->getOriginalState($entity)
        ->id());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.