public function AuditFilesConfigTest::testConfigPageContent in Audit Files 8.2
Same name and namespace in other branches
- 8.3 tests/src/Functional/AuditFilesConfigTest.php \Drupal\Tests\auditfiles\Functional\AuditFilesConfigTest::testConfigPageContent()
Tests that the config page has correct settings.
File
- tests/
src/ Functional/ AuditFilesConfigTest.php, line 82
Class
- AuditFilesConfigTest
- Tests that the "Managed not used" report is reachable with no errors.
Namespace
Drupal\Tests\auditfiles\FunctionalCode
public function testConfigPageContent() {
// Form to test.
$path = URL::fromRoute('auditfiles.auditfiles_configuration');
// Establish session.
$session = $this
->assertSession();
// Log in as admin user.
$this
->drupalLogin($this->user);
// Load the report page.
$this
->drupalGet($path);
// Check for the report title.
$session
->pageTextContains("Audit Files");
// Check for form elements
$session
->elementExists('css', '#edit-auditfiles-file-system-path');
$session
->elementExists('css', '#edit-auditfiles-file-system-path > option:nth-child(1)');
$session
->elementAttributeContains('css', '#edit-auditfiles-file-system-path > option:nth-child(1)', 'value', 'public');
$session
->elementExists('css', '#edit-auditfiles-file-system-path > option:nth-child(2)');
$session
->elementAttributeContains('css', '#edit-auditfiles-file-system-path > option:nth-child(2)', 'value', 'temporary');
$session
->elementExists('css', '#edit-auditfiles-exclude-files');
$session
->elementAttributeContains('css', '#edit-auditfiles-exclude-files', 'value', '.htaccess');
$session
->elementExists('css', '#edit-auditfiles-exclude-extensions');
$session
->elementAttributeContains('css', '#edit-auditfiles-exclude-extensions', 'value', '');
$session
->elementExists('css', '#edit-auditfiles-exclude-paths');
$session
->elementAttributeContains('css', '#edit-auditfiles-exclude-paths', 'value', 'color;css;ctools;js');
$session
->elementExists('css', '#edit-auditfiles-include-domains');
$session
->elementAttributeContains('css', '#edit-auditfiles-include-domains', 'value', '');
$session
->elementExists('css', '#edit-auditfiles-report-options-date-format');
$session
->elementExists('css', '#edit-auditfiles-report-options-date-format > option:nth-child(1)');
$session
->elementAttributeContains('css', '#edit-auditfiles-report-options-date-format > option:nth-child(1)', 'value', 'fallback');
$session
->elementExists('css', '#edit-auditfiles-report-options-items-per-page');
$session
->elementAttributeContains('css', '#edit-auditfiles-report-options-items-per-page', 'value', '50');
$session
->elementExists('css', '#edit-auditfiles-report-options-maximum-records');
$session
->elementAttributeContains('css', '#edit-auditfiles-report-options-maximum-records', 'value', '250');
$session
->elementExists('css', '#edit-auditfiles-report-options-batch-size');
$session
->elementAttributeContains('css', '#edit-auditfiles-report-options-batch-size', 'value', '1000');
}