You are here

function GeshiFilterAdministrationTest::setUp in GeSHi Filter for syntax highlighting 7

Same name and namespace in other branches
  1. 6 geshifilter.test \GeshiFilterAdministrationTest::setUp()

SimpleTest core method: code run before each and every test method.

Optional. You only need this if you have setup tasks.

Overrides DrupalWebTestCase::setUp

File

./geshifilter.test, line 42
Tests for the GeSHi filter module.

Class

GeshiFilterAdministrationTest
Funcional tests for the GeSHi filter administration.

Code

function setUp() {

  // Make sure the GeSHi filter module is enabled.
  parent::setUp('geshifilter');

  // And set the path to the geshi library.
  variable_set('geshifilter_geshi_dir', 'sites/all/libraries/geshi');

  // Create a filter admin user
  $permissions = array(
    'administer filters',
    'administer site configuration',
  );
  $this->filter_admin_user = $this
    ->drupalCreateUser($permissions);

  // log in with filter admin user
  $this
    ->drupalLogin($this->filter_admin_user);

  // add an text format with only geshi filter
  $this
    ->createTextFormat('geshifilter_text_format', array(
    'geshifilter',
  ));

  // store the format id of the created text format
  $this->input_format_id = 'geshifilter_text_format';

  // set some default GeSHi filter admin settings
  variable_set('geshifilter_format_specific_options', FALSE);
  variable_set('geshifilter_tag_styles', array(
    GESHIFILTER_BRACKETS_ANGLE => GESHIFILTER_BRACKETS_ANGLE,
    GESHIFILTER_BRACKETS_SQUARE => GESHIFILTER_BRACKETS_SQUARE,
  ));
  variable_set('geshifilter_default_line_numbering', GESHIFILTER_LINE_NUMBERS_DEFAULT_NONE);
}