syslog.test 1.08 KB
Newer Older
1
2
3
4
<?php
// $Id$

class SyslogTestCase extends DrupalWebTestCase {
5
  public static function getInfo() {
6
    return array(
7
8
9
      'name' => 'Syslog functionality',
      'description' => 'Test syslog settings.',
      'group' => 'Syslog'
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
    );
  }

  function setUp() {
    parent::setUp('syslog');
  }

  /**
   * Test the syslog settings page.
   */
  function testSettings() {
    $admin_user = $this->drupalCreateUser(array('administer site configuration'));
    $this->drupalLogin($admin_user);

    $edit = array();
25
    // If we're on Windows, there is no configuration form.
26
    if (defined('LOG_LOCAL6')) {
27
28
29
30
31
32
33
34
      $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="' . LOG_LOCAL6 . '"]'); // Should be one field.
        $this->assertTrue($field[0]['selected'] == 'selected', t('Facility value saved.'));
      }
35
36
37
    }
  }
}