public function testShouldGetDefaultActionDirectroyName()
 {
     $path = dirname(dirname(__FILE__)) . '/apps/sample/';
     $dispatcher = new Net_URL_Dispatcher(__METHOD__);
     $directroy = $dispatcher->getActionDirectoryName();
     $this->assertSame('actions', $directroy);
 }
 public function testShouldDispatchToAnotherSubDirectory()
 {
     $path = dirname(dirname(__FILE__)) . '/apps/sample/';
     $dispatcher = new Net_URL_Dispatcher(__METHOD__);
     $dispatcher->setActionDirectoryName('others/Sub');
     $_ENV['PATH_INFO'] = 'bar';
     ob_start();
     $dispatcher->connect(':action')->dispatch($path);
     $buffer = ob_get_contents();
     ob_end_clean();
     $this->assertSame($buffer, 'BarAction_execute');
 }
 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');
 }