home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (syslog.test)

This example Drupal source code file (syslog.test) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

admin_user, array, configuration, extends, field, function, if, log_local6, php, return, saved, selected, should, syslog

The syslog.test Drupal example source code

<?php
// $Id: syslog.test,v 1.14 2010/08/05 23:53:39 webchick Exp $

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.'));
      }
    }
  }
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal syslog.test source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.