/** * Determines the parameters and calls Set * * @param $method * @param $arguments * * @return mixed * @throws InvalidArgumentException */ private function runSetMethod($method, $arguments) { $property = studly_case($method); if (count($arguments) !== 1) { throw new InvalidArgumentException(sprintf("You must pass a value to set for the property [%s].", $property)); } $value = $arguments[0]; $this->filter = $this->filter->set($property, $value); return $this; }
/** * @test * @expectedException InvalidArgumentException */ public function it_raises_exception_when_passing_an_invalid_filter_name() { $this->filter->set(null, 'value'); }