function DrupalMatchPathTestCase::testDrupalMatchPath

Run through our test cases, making sure each one works as expected.

File

modules/simpletest/tests/path.test, line 38

Class

DrupalMatchPathTestCase
Unit tests for the drupal_match_path() function in path.inc.

Code

function testDrupalMatchPath() {
    // Set up our test cases.
    $tests = $this->drupalMatchPathTests();
    foreach ($tests as $patterns => $cases) {
        foreach ($cases as $path => $expected_result) {
            $actual_result = drupal_match_path($path, $patterns);
            $this->assertIdentical($actual_result, $expected_result, format_string('Tried matching the path <code>@path</code> to the pattern <pre>@patterns</pre> - expected @expected, got @actual.', array(
                '@path' => $path,
                '@patterns' => $patterns,
                '@expected' => var_export($expected_result, TRUE),
                '@actual' => var_export($actual_result, TRUE),
            )));
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.