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