/** * @covers Braincrafted\ArrayQuery\Factory\OperatorFactory::getOperators() */ public function testGetOperators() { $operators = OperatorFactory::getOperators(); $this->assertCount(8, $operators); foreach ($operators as $operator) { $this->assertInstanceOf('Braincrafted\\ArrayQuery\\Operator\\OperatorInterface', $operator); } }
/** * @param WhereEvaluation $whereEvaluation * * @return WhereEvaluation */ protected function getWhereEvaluation($whereEvaluation = null) { if (null !== $whereEvaluation && false === $whereEvaluation instanceof WhereEvaluation) { throw new \InvalidArgumentException('Argument "whereEvaluation" must be an instance of WhereEvaluation.'); } if (null === $whereEvaluation) { $whereEvaluation = new WhereEvaluation(); } foreach (OperatorFactory::getOperators() as $operator) { $whereEvaluation->addOperator($operator); } foreach (FilterFactory::getFilters() as $filter) { $whereEvaluation->addFilter($filter); } return $whereEvaluation; }