diff options
Diffstat (limited to 'core/modules/syslog/syslog.test')
-rw-r--r-- | core/modules/syslog/syslog.test | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/core/modules/syslog/syslog.test b/core/modules/syslog/syslog.test new file mode 100644 index 00000000000..691fb7deeb3 --- /dev/null +++ b/core/modules/syslog/syslog.test @@ -0,0 +1,41 @@ +<?php + +/** + * @file + * Tests for syslog.module. + */ + +class SyslogTestCase extends DrupalWebTestCase { + public static function getInfo() { + return array( + 'name' => 'Syslog functionality', + 'description' => 'Test syslog settings.', + 'group' => 'Syslog' + ); + } + + 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(); + // 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', t('Facility value saved.')); + } + } + } +} |