Пример #1
0
 /**
  * @return Filter
  */
 public function having()
 {
     if (!isset($this->_having)) {
         $this->_having = Factory::filter($this);
     }
     return $this->_having;
 }
Пример #2
0
 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;
 }
Пример #4
0
 public function testShouldDefineParamsWhenFilterNameIsACallback()
 {
     $factory = new Factory();
     $callback = $factory->filter('json_encode', array(JSON_ERROR_SYNTAX));
     $this->assertSame(array(JSON_ERROR_SYNTAX), $callback->getCallbackParams());
 }