Exemple #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']);
 }
Exemple #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']);
 }
Exemple #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');
 }
Exemple #4
0
 /**
  * Test simple URL generator behaviours
  */
 public function testOtherStuff()
 {
     $this->assertEquals($this->router->getPrefix($this->router->setPrefix(['hello', 'world'])), ['hello', 'world']);
 }