You are here

function PathfilterTestCase::testInternalRelative in Path Filter 6

Same name and namespace in other branches
  1. 6.2 tests/pathfilter.test \PathfilterTestCase::testInternalRelative()
  2. 7 tests/pathfilter.test \PathfilterTestCase::testInternalRelative()

test_pathfilter

File

tests/pathfilter.test, line 87
Tests for Path Filter

Class

PathfilterTestCase

Code

function testInternalRelative() {
  variable_set('pathfilter_link_absolute_1', 0);

  // Create node for testing.
  $node = $this
    ->drupalCreateNode();
  $snippets = array(
    '"internal:admin/user"' => '"/admin/user"',
    '\'internal:admin/user\'' => "'/admin/user'",
    // single quotes
    '"internal:node/nid"' => '"/node/nid"',
    '"internal:node/' . $node->nid . '"' => '"' . drupal_get_path_alias('/node/' . $node->nid) . '"',
    '"internal:node/nid?page=1#section2"' => '"/node/nid?page=1#section2"',
  );
  $this
    ->CompareSnippets($snippets);
}