public function AuthcacheP13nTestDefaultRequestRouter::testLookup in Authenticated User Page Caching (Authcache) 7.2
Test whether the frontcontroller responds correctly to a valid request.
File
- modules/
authcache_p13n/ tests/ authcache_p13n.frontcontroller.test, line 265 - Defines tests for authcache frontcontroller for personalized requests.
Class
- AuthcacheP13nTestDefaultRequestRouter
- Tests for default router.
Code
public function testLookup() {
// Ensure that the request handler is not present in the router.
$handler = $this->router
->getHandler('test/stub');
$this
->assertNull($handler);
// Enable stub module.
module_enable(array(
'authcache_p13n_test',
));
$this
->resetAll();
authcache_p13n_request_router_rebuild();
$this
->assertTrue(authcache_p13n_request_exists('test/stub'));
// Ensure that the router returns the proper request object.
$handler = $this->router
->getHandler('test/stub');
$this
->assertEqual(new AuthcacheP13nTestRequestHandlerStub(), $handler);
}