/** * @return Filter */ public function having() { if (!isset($this->_having)) { $this->_having = Factory::filter($this); } return $this->_having; }
public function testShouldUseOneOfFilterWhenInputHasContainsTheWordOr() { $expectedFilter = new Filter\OneOf(array(new Filter\GreaterThan(42), new Filter\EqualTo(42))); $factory = new Factory(); $actualFilter = $factory->filter('greaterThanOrEqualTo', array(42)); $this->assertEquals($expectedFilter, $actualFilter); }
/** * @return Filter */ public function filter() { if (!isset($this->_filter)) { $this->_filter = Factory::filter($this); } return $this->_filter; }
public function testShouldDefineParamsWhenFilterNameIsACallback() { $factory = new Factory(); $callback = $factory->filter('json_encode', array(JSON_ERROR_SYNTAX)); $this->assertSame(array(JSON_ERROR_SYNTAX), $callback->getCallbackParams()); }