public function getParameter($id) { if (!isset($this->params[$id])) { throw new \InvalidArgumentException("There is no param defined with id [{$id}]"); } return $this->params[$id]; }
/** * @expectedException InvalidArgumentException * @expectedExceptionMessage There is no param defined with id [abc] */ public function testGetParamWithoutSet() { $this->context->getParameter('abc'); }