Beispiel #1
0
 public function testClearParams()
 {
     $this->_controller->setParams(array('foo' => 'bar', 'baz' => 'bat'));
     $params = $this->_controller->getParams();
     $this->assertTrue(isset($params['foo']));
     $this->assertTrue(isset($params['baz']));
     $this->_controller->clearParams('foo');
     $params = $this->_controller->getParams();
     $this->assertFalse(isset($params['foo']));
     $this->assertTrue(isset($params['baz']));
     $this->_controller->clearParams();
     $this->assertSame(array(), $this->_controller->getParams());
     $this->_controller->setParams(array('foo' => 'bar', 'bar' => 'baz', 'baz' => 'bat'));
     $this->assertSame(array('foo' => 'bar', 'bar' => 'baz', 'baz' => 'bat'), $this->_controller->getParams());
     $this->_controller->clearParams(array('foo', 'baz'));
     $this->assertSame(array('bar' => 'baz'), $this->_controller->getParams());
 }