syslog.test

Tests for syslog.module.

File

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