public function ScheduledTransitionSettingsFormTest::testMirrorOperations in Scheduled Transitions 2.x
Same name and namespace in other branches
- 8 tests/src/Functional/ScheduledTransitionSettingsFormTest.php \Drupal\Tests\scheduled_transitions\Functional\ScheduledTransitionSettingsFormTest::testMirrorOperations()
Tests mirror operations settings.
File
- tests/
src/ Functional/ ScheduledTransitionSettingsFormTest.php, line 66
Class
- ScheduledTransitionSettingsFormTest
- Tests settings form.
Namespace
Drupal\Tests\scheduled_transitions\FunctionalCode
public function testMirrorOperations() : void {
// Set operation values to nothing.
\Drupal::configFactory()
->getEditable('scheduled_transitions.settings')
->clear('mirror_operations.view scheduled transition')
->clear('mirror_operations.add scheduled transition')
->save(TRUE);
$currentUser = $this
->drupalCreateUser([
'administer scheduled transitions',
]);
$this
->drupalLogin($currentUser);
$url = Url::fromRoute('scheduled_transitions.settings');
$this
->drupalGet($url);
$this
->assertSession()
->fieldValueEquals('mirror_operation_view', '');
$this
->assertSession()
->fieldValueEquals('mirror_operation_add', '');
$edit = [
'mirror_operation_view' => 'update',
'mirror_operation_add' => 'update',
];
$this
->drupalPostForm(NULL, $edit, 'Save configuration');
$this
->assertSession()
->pageTextContains('The configuration options have been saved.');
$this
->assertSession()
->fieldValueEquals('mirror_operation_view', 'update');
$this
->assertSession()
->fieldValueEquals('mirror_operation_add', 'update');
}