function SyslogTestCase::testSettings

Tests the syslog settings page.

File

modules/syslog/syslog.test, line 27

Class

SyslogTestCase
Tests the Syslog module functionality.

Code

function testSettings() {
    $admin_user = $this->drupalCreateUser(array(
        'administer site configuration',
    ));
    $this->drupalLogin($admin_user);
    $edit = array();
    // If we're on Windows, there is no configuration form.
    if (defined('LOG_LOCAL6')) {
        $this->drupalPost('admin/config/development/logging', array(
            'syslog_facility' => LOG_LOCAL6,
        ), t('Save configuration'));
        $this->assertText(t('The configuration options have been saved.'));
        $this->drupalGet('admin/config/development/logging');
        if ($this->parse()) {
            $field = $this->xpath('//option[@value=:value]', array(
                ':value' => LOG_LOCAL6,
            ));
            // Should be one field.
            $this->assertTrue($field[0]['selected'] == 'selected', 'Facility value saved.');
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.