public function testShouldGetControllerDirectroryName() { $path = dirname(dirname(__FILE__)) . '/apps/sample/'; $dispatcher = new Net_URL_Dispatcher(__METHOD__); $dispatcher->setControllerDirectoryName('bar'); $directroy = $dispatcher->getControllerDirectoryName(); $this->assertSame('bar', $directroy); }
public function testShouldDispatchToAnotherSubDirectory() { $path = dirname(dirname(__FILE__)) . '/apps/sample/'; $dispatcher = new Net_URL_Dispatcher(__METHOD__); $dispatcher->setControllerDirectoryName('others/Sub'); $_ENV['PATH_INFO'] = '/bar/index'; ob_start(); $dispatcher->connect(':controller/:action/*params')->dispatch($path); $buffer = ob_get_contents(); ob_end_clean(); $this->assertSame($buffer, 'BarController_indexAction'); }