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