silverstripe-framework/tests/HTTPRequestTest.php
Ingo Schommer b5776e0438 (merged from branches/roa. use "svn log -c <changeset> -g <module-svn-path>" for detailed commit message)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60207 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-08-09 03:54:55 +00:00

18 lines
569 B
PHP

<?php
class HTTPRequestTest extends SapphireTest {
static $fixture_file = null;
function testMatch() {
$request = new HTTPRequest("GET", "admin/crm/add");
/* When a rule matches, but has no variables, array("_matched" => true) is returned. */
$this->assertEquals(array("_matched" => true), $request->match('admin/crm', true));
/* Becasue we shifted admin/crm off the stack, just "add" should be remaining */
$this->assertEquals("add", $request->remaining());
$this->assertEquals(array("_matched" => true), $request->match('add', true));
}
}