function ModerationFormTest::testAlternativeModerationStateWidget
Same name in other branches
- 9 core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php \Drupal\Tests\content_moderation\Functional\ModerationFormTest::testAlternativeModerationStateWidget()
- 8.9.x core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php \Drupal\Tests\content_moderation\Functional\ModerationFormTest::testAlternativeModerationStateWidget()
- 10 core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php \Drupal\Tests\content_moderation\Functional\ModerationFormTest::testAlternativeModerationStateWidget()
Tests the moderation_state field when an alternative widget is set.
File
-
core/
modules/ content_moderation/ tests/ src/ Functional/ ModerationFormTest.php, line 493
Class
- ModerationFormTest
- Tests the moderation form, specifically on nodes.
Namespace
Drupal\Tests\content_moderation\FunctionalCode
public function testAlternativeModerationStateWidget() : void {
$entity_form_display = EntityFormDisplay::load('node.moderated_content.default');
$entity_form_display->setComponent('moderation_state', [
'type' => 'string_textfield',
'region' => 'content',
]);
$entity_form_display->save();
$this->drupalGet('node/add/moderated_content');
$this->submitForm([
'title[0][value]' => 'Test content',
'moderation_state[0][value]' => 'published',
], 'Save');
$this->assertSession()
->pageTextContains('Moderated content Test content has been created.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.