Project

General

Profile

Paste
Download (1.18 KB) Statistics
| Branch: | Revision:

root / drupal7 / modules / syslog / syslog.test @ 27e02aed

1 85ad3d82 Assos Assos
<?php
2
3
/**
4
 * @file
5
 * Tests for syslog.module.
6
 */
7
8
/**
9
 * Tests the Syslog module functionality.
10
 */
11
class SyslogTestCase extends DrupalWebTestCase {
12
  public static function getInfo() {
13
    return array(
14
      'name' => 'Syslog functionality',
15
      'description' => 'Test syslog settings.',
16
      'group' => 'Syslog'
17
    );
18
  }
19
20
  function setUp() {
21
    parent::setUp('syslog');
22
  }
23
24
  /**
25
   * Tests the syslog settings page.
26
   */
27
  function testSettings() {
28
    $admin_user = $this->drupalCreateUser(array('administer site configuration'));
29
    $this->drupalLogin($admin_user);
30
31
    $edit = array();
32
    // If we're on Windows, there is no configuration form.
33
    if (defined('LOG_LOCAL6')) {
34
      $this->drupalPost('admin/config/development/logging', array('syslog_facility' => LOG_LOCAL6), t('Save configuration'));
35
      $this->assertText(t('The configuration options have been saved.'));
36
37
      $this->drupalGet('admin/config/development/logging');
38
      if ($this->parse()) {
39
        $field = $this->xpath('//option[@value=:value]', array(':value' => LOG_LOCAL6)); // Should be one field.
40
        $this->assertTrue($field[0]['selected'] == 'selected', 'Facility value saved.');
41
      }
42
    }
43
  }
44
}