public function NodeViewCountSettingsFormTest::testEditingSettings in Node view count 8
Tests that settings are changed on form submit.
File
- src/
Tests/ NodeViewCountSettingsFormTest.php, line 43
Class
- NodeViewCountSettingsFormTest
- Tests settings form of nodeviewcount module.
Namespace
Drupal\nodeviewcount\TestsCode
public function testEditingSettings() {
$this
->drupalLogin($this->adminUser);
$this
->drupalGet('admin/config/content/nodeviewcount');
$edit = [
'logs_life_time' => 604800,
'user_roles[authenticated]' => TRUE,
];
$this
->drupalPostForm(NULL, $edit, $this
->t('Save configuration'));
$this
->assertFieldChecked('edit-user-roles-authenticated');
$this
->assertNoFieldById('edit-excluded-user-roles-authenticated');
$this
->assertOptionSelected('edit-logs-life-time', 604800);
$this
->drupalLogout();
}