public function ModerationInformationTest::testIsModeratedEntityForm in Workbench Moderation 8.2
Same name and namespace in other branches
- 8 tests/src/Unit/ModerationInformationTest.php \Drupal\Tests\workbench_moderation\Unit\ModerationInformationTest::testIsModeratedEntityForm()
@dataProvider providerBoolean @covers ::isModeratedEntityForm
File
- tests/
src/ Unit/ ModerationInformationTest.php, line 108
Class
- ModerationInformationTest
- @coversDefaultClass \Drupal\workbench_moderation\ModerationInformation @group workbench_moderation
Namespace
Drupal\Tests\workbench_moderation\UnitCode
public function testIsModeratedEntityForm($status) {
$entity_type = new ContentEntityType([
'id' => 'test_entity_type',
'bundle_entity_type' => 'entity_test_bundle',
]);
$entity = $this
->prophesize(ContentEntityInterface::class);
$entity
->getEntityType()
->willReturn($entity_type);
$entity
->bundle()
->willReturn('test_bundle');
$form = $this
->prophesize(ContentEntityFormInterface::class);
$form
->getEntity()
->willReturn($entity);
$moderation_information = new ModerationInformation($this
->setupModerationEntityManager($status), $this
->getUser());
$this
->assertEquals($status, $moderation_information
->isModeratedEntityForm($form
->reveal()));
}