public function ScannerAdminTest::testAdminSettingsForm in Search and Replace Scanner 8
Tests that the base admin settings form is functional.
File
- tests/
src/ Functional/ ScannerAdminTest.php, line 50
Class
- ScannerAdminTest
- Tests the default admin settings functionality.
Namespace
Drupal\Tests\scanner\FunctionalCode
public function testAdminSettingsForm() {
// Confirm the settings form loads.
$this
->drupalGet('admin/config/content/scanner');
$session_assert = $this
->assertSession();
$session_assert
->statusCodeEquals(200);
// Check for all checkboxes including the test content type.
$session_assert
->fieldExists('scanner_mode');
$session_assert
->fieldExists('scanner_wholeword');
$session_assert
->fieldExists('scanner_regex');
$session_assert
->fieldExists('scanner_published');
$session_assert
->fieldExists('scanner_pathauto');
$session_assert
->fieldExists('scanner_language');
// Assert that the entity types are available but not enabled by default.
$session_assert
->checkboxNotChecked('enabled_content_types[node:scanner_test_node_type]');
$session_assert
->checkboxNotChecked('enabled_content_types[node:scanner_test_ignored_node_type]');
}