public function testSettingDefaultOptionsAfterwards() { $filter = new CallbackFilter(array($this, 'objectCallback')); $filter->setCallbackParams('param'); $this->assertEquals(array('param'), $filter->getCallbackParams()); $this->assertEquals('objectCallback-test', $filter('test')); }
/** * Sets a new Closure for this filter * * @param Closure $callback * @throws Exception\InvalidArgumentException * @return self */ public function setCallback($callback) { if (!$callback instanceof Closure) { throw new Exception\InvalidArgumentException(sprintf('Invalid parameter for callback: must be %s', Closure::class)); } return parent::setCallback($callback); }