Web\UrlTest: test the new matches() function

refs #6992
This commit is contained in:
Thomas Gelf 2014-09-04 18:59:22 +02:00
parent 7b35741985
commit dd943c3aa7
1 changed files with 20 additions and 0 deletions

View File

@ -305,6 +305,26 @@ class UrlTest extends BaseTestCase
);
}
public function testWhetherEqualUrlMaches()
{
$url1 = '/whatever/is/here?a=b&c=d';
$url2 = Url::fromPath('whatever/is/here', array('a' => 'b', 'c' => 'd'));
$this->assertEquals(
true,
$url2->matches($url1)
);
}
public function testWhetherDifferentUrlDoesNotMatch()
{
$url1 = '/whatever/is/here?a=b&d=d';
$url2 = Url::fromPath('whatever/is/here', array('a' => 'b', 'c' => 'd'));
$this->assertEquals(
false,
$url2->matches($url1)
);
}
/**
* @depends testWhetherGetAbsoluteUrlReturnsTheAbsoluteUrlForHtmlAttributes
*/