mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT Added RequestHandlingTest->testNestedBase()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63650 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
cc6ef50377
commit
eff1f50041
@ -66,6 +66,12 @@ class RequestHandlingTest extends SapphireTest {
|
|||||||
$response = Director::test("testBaseWithExtension/virtualfile");
|
$response = Director::test("testBaseWithExtension/virtualfile");
|
||||||
$this->assertEquals("This is the virtualfile method", $response->getBody());
|
$this->assertEquals("This is the virtualfile method", $response->getBody());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function testNestedBase() {
|
||||||
|
/* Nested base should leave out the two parts and correctly map arguments */
|
||||||
|
$response = Director::test("testParentBase/testChildBase/method/1/2");
|
||||||
|
$this->assertEquals("This is a method on the controller: 1, 2", $response->getBody());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -89,6 +95,9 @@ Director::addRules(50, array(
|
|||||||
|
|
||||||
// Without the extension, the methodname should be matched
|
// Without the extension, the methodname should be matched
|
||||||
'testBaseWithExtension//$Action/$ID/$OtherID' => "RequestHandlingTest_Controller",
|
'testBaseWithExtension//$Action/$ID/$OtherID' => "RequestHandlingTest_Controller",
|
||||||
|
|
||||||
|
// Test nested base
|
||||||
|
'testParentBase/testChildBase//$Action/$ID/$OtherID' => "RequestHandlingTest_Controller",
|
||||||
));
|
));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user