class SyslogTest in Drupal 10
Same name in this branch
- 10 core/modules/syslog/tests/src/Functional/SyslogTest.php \Drupal\Tests\syslog\Functional\SyslogTest
- 10 core/modules/syslog/tests/src/Kernel/SyslogTest.php \Drupal\Tests\syslog\Kernel\SyslogTest
- 10 core/modules/syslog/tests/modules/syslog_test/src/Logger/SysLogTest.php \Drupal\syslog_test\Logger\SysLogTest
Same name and namespace in other branches
- 8 core/modules/syslog/tests/src/Functional/SyslogTest.php \Drupal\Tests\syslog\Functional\SyslogTest
- 9 core/modules/syslog/tests/src/Functional/SyslogTest.php \Drupal\Tests\syslog\Functional\SyslogTest
Tests syslog settings.
@group syslog
Hierarchy
- class \Drupal\Tests\BrowserTestBase extends \PHPUnit\Framework\TestCase uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, FunctionalTestSetupTrait, TestSetupTrait, BlockCreationTrait, ConfigTestTrait, ExtensionListTestTrait, ContentTypeCreationTrait, NodeCreationTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings, UiHelperTrait, UserCreationTrait, XdebugRequestTrait
- class \Drupal\Tests\syslog\Functional\SyslogTest
Expanded class hierarchy of SyslogTest
File
- core/
modules/ syslog/ tests/ src/ Functional/ SyslogTest.php, line 12
Namespace
Drupal\Tests\syslog\FunctionalView source
class SyslogTest extends BrowserTestBase {
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = [
'syslog',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests the syslog settings page.
*/
public function testSettings() {
$admin_user = $this
->drupalCreateUser([
'administer site configuration',
]);
$this
->drupalLogin($admin_user);
// If we're on Windows, there is no configuration form.
if (defined('LOG_LOCAL6')) {
$this
->drupalGet('admin/config/development/logging');
$this
->submitForm([
'syslog_facility' => LOG_LOCAL6,
], 'Save configuration');
$this
->assertSession()
->pageTextContains('The configuration options have been saved.');
$this
->drupalGet('admin/config/development/logging');
// Should be one field.
$field = $this
->xpath('//option[@value=:value]', [
':value' => LOG_LOCAL6,
]);
$this
->assertSame('selected', $field[0]
->getAttribute('selected'), 'Facility value saved.');
}
}
}