示例#1
0
 /**
  * Test bundle with method URL handler behaviours
  */
 public function testLangBundleMethodParamsUrlHandler()
 {
     $this->router->handle('/en/test/method/param1/param2');
     $this->assertEquals($this->router->getActionNamespace(), 'Test\\Action\\Method\\CliMethodAction');
     $this->assertEquals($this->router->getResponderNamespace(), 'Test\\Responder\\Method\\CliMethodResponder');
     $this->assertEquals($this->router->getAction(), 'CliMethod');
     $this->assertEquals($this->router->getBundle(), 'test');
     $this->assertEquals($this->router->getParams(), ['param1', 'param2']);
 }
示例#2
0
 /**
  * Test bundle and action in subdirectory and params URL handler behaviours
  */
 public function testBundleSubdirActionParamsUrlHandler()
 {
     $this->router->handle('/_/test/param1/subdir/param2/test/param3/');
     $this->assertEquals($this->router->getActionNamespace(), 'Test\\Action\\Subdir\\TestAction');
     $this->assertEquals($this->router->getResponderNamespace(), 'Test\\Responder\\Subdir\\TestResponder');
     $this->assertEquals($this->router->getAction(), 'test');
     $this->assertEquals($this->router->getBundle(), 'test');
     $this->assertEquals($this->router->getParams(), ['param1', 'param2', 'param3']);
 }
示例#3
0
 /**
  * Test simple URL generator behaviours
  */
 public function testSimpleUrlGenerator()
 {
     $this->assertEquals($this->router->generateUrl(), '/');
     $this->assertEquals($this->router->generateUrl(['url']), '/url');
     $this->assertEquals($this->router->generateUrl(['url', 'test']), '/url/test');
 }
示例#4
0
文件: EtcTest.php 项目: radphp/radphp
 /**
  * Test simple URL generator behaviours
  */
 public function testOtherStuff()
 {
     $this->assertEquals($this->router->getPrefix($this->router->setPrefix(['hello', 'world'])), ['hello', 'world']);
 }