SyslogTest.php in Drupal 9
File
core/modules/syslog/tests/src/Functional/SyslogTest.php
View source
<?php
namespace Drupal\Tests\syslog\Functional;
use Drupal\Tests\BrowserTestBase;
class SyslogTest extends BrowserTestBase {
protected static $modules = [
'syslog',
];
protected $defaultTheme = 'stark';
public function testSettings() {
$admin_user = $this
->drupalCreateUser([
'administer site configuration',
]);
$this
->drupalLogin($admin_user);
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');
$field = $this
->xpath('//option[@value=:value]', [
':value' => LOG_LOCAL6,
]);
$this
->assertSame('selected', $field[0]
->getAttribute('selected'), 'Facility value saved.');
}
}
}