--- Zend/Controller/ActionTest.php (revision 19708) +++ Zend/Controller/ActionTest.php (working copy) @@ -227,6 +227,20 @@ $this->assertTrue(isset($params['foo'])); $this->assertEquals('bar', $params['foo']); } + + /** + * @group ZF-5163 + */ + public function testGetParam() + { + $this->_controller->setParam('foo', 'bar'); + $this->_controller->setParam('bar', 0); + $this->_controller->setParam('baz', null); + + $this->assertEquals('bar', $this->_controller->getParam('foo', -1)); + $this->assertEquals(0, $this->_controller->getParam('bar', -1)); + $this->assertEquals(-1, $this->_controller->getParam('baz', -1)); + } public function testGetParams() { @@ -543,6 +557,11 @@ $this->_setParam($key, $value); return $this; } + + public function getParam($key, $default) + { + return $this->_getParam($key, $default); + } public function redirect($url, $code = 302, $prependBase = true) {