You are here

public function PathfilterTestCase::testInternalRelative in Path Filter 7

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

test_pathfilter

1 call to PathfilterTestCase::testInternalRelative()
PathfilterTestCase::testNoCleanURLs in tests/pathfilter.test
test with clean URL's disabled

File

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

Class

PathfilterTestCase

Code

public function testInternalRelative() {
  variable_set('pathfilter_link_absolute_1', 0);
  $settings = array(
    'type' => 'story',
    'language' => '',
    'uid' => '1',
    'status' => '1',
    'promote' => '1',
    'moderate' => '0',
    'sticky' => '0',
    'tnid' => '0',
    'translate' => '0',
    'title' => 'Test Pathfilter',
    'body' => '',
    'log' => '',
    'format' => '1',
  );

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