public function setOptions($options) { parent::setOptions($options); //Make sure the view model is available in the view $this->widget = $this; foreach ($options as $name => $value) { $this->{$name} = $value; } }
public function testPassingAnInvalidArgumentToSetOptionsRaisesAnException() { $model = new ViewModel(); $this->setExpectedException('Zend\\View\\Exception\\InvalidArgumentException', 'expects an array'); $model->setOptions(new stdClass()); }