comparison core/modules/syslog/tests/src/Functional/SyslogTest.php @ 0:c75dbcec494b

Initial commit from drush-created site
author Chris Cannam
date Thu, 05 Jul 2018 14:24:15 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c75dbcec494b
1 <?php
2
3 namespace Drupal\Tests\syslog\Functional;
4
5 use Drupal\Tests\BrowserTestBase;
6
7 /**
8 * Tests syslog settings.
9 *
10 * @group syslog
11 */
12 class SyslogTest extends BrowserTestBase {
13
14 /**
15 * Modules to enable.
16 *
17 * @var array
18 */
19 public static $modules = ['syslog'];
20
21 /**
22 * Tests the syslog settings page.
23 */
24 public function testSettings() {
25 $admin_user = $this->drupalCreateUser(['administer site configuration']);
26 $this->drupalLogin($admin_user);
27
28 // If we're on Windows, there is no configuration form.
29 if (defined('LOG_LOCAL6')) {
30 $this->drupalPostForm('admin/config/development/logging', ['syslog_facility' => LOG_LOCAL6], t('Save configuration'));
31 $this->assertText(t('The configuration options have been saved.'));
32
33 $this->drupalGet('admin/config/development/logging');
34 // Should be one field.
35 $field = $this->xpath('//option[@value=:value]', [':value' => LOG_LOCAL6]);
36 $this->assertSame('selected', $field[0]->getAttribute('selected'), 'Facility value saved.');
37 }
38 }
39
40 }