public function getParam($name = null, $default = null) { if (is_null($name)) { throw new InvalidArgumentException('Param name is expected.'); } return $this->application->getParam($name, $default); }
public function testGetParamShouldWork() { $router = $this->getRouter(); $router->enableSearchEngineFriendly(false); $app = new Piano\Application($this->getConfig(), $router); $app->setUrl('/admin/index/index'); $this->assertFalse($app->getParam()); $app->setUrl('/admin/index/index/id/5/value/teste'); $this->assertFalse($app->getParam()); $this->assertEquals('5', $app->getParam('id')); $this->assertEquals('teste', $app->getParam('value')); }