1 path.test BackdropMatchPathTestCase::testBackdropMatchPath()

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

File

core/modules/simpletest/tests/path.test, line 29
Tests for path.inc.

Class

BackdropMatchPathTestCase
Unit tests for the backdrop_match_path() function in path.inc.

Code

function testBackdropMatchPath() {
  // Set up our test cases.
  $tests = $this->backdropMatchPathTests();
  foreach ($tests as $patterns => $cases) {
    foreach ($cases as $path => $expected_result) {
      $actual_result = backdrop_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))));
    }
  }
}