コード例 #1
0
 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');
 }
コード例 #2
0
 public function testShouldGetActionDirectroryName()
 {
     $path = dirname(dirname(__FILE__)) . '/apps/sample/';
     $dispatcher = new Net_URL_Dispatcher(__METHOD__);
     $dispatcher->setActionDirectoryName('bar');
     $directroy = $dispatcher->getActionDirectoryName();
     $this->assertSame('bar', $directroy);
 }