public function ModerationInformationTest::testGetOriginalState in Drupal 9
Same name and namespace in other branches
- 8 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 185
Class
- ModerationInformationTest
- @coversDefaultClass \Drupal\content_moderation\ModerationInformation @group content_moderation
Namespace
Drupal\Tests\content_moderation\KernelCode
public function testGetOriginalState() {
$entity = EntityTestMulRevPub::create([
'moderation_state' => 'published',
]);
$entity
->save();
$entity->moderation_state = 'foo';
$this
->assertEquals('published', $this->moderationInformation
->getOriginalState($entity)
->id());
}