/** * findBy * * @param array $criteria * @param array $orderBy * @param null $limit * @param null $offset * * @throws \Brown298\DataTablesBundle\Exceptions\ProcessorException */ public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) { if (!$this->serverProcessorService instanceof ServerProcessService) { throw new ProcessorException('The container must be set'); } if (!$this->repository instanceof EntityRepository) { throw new ProcessorException('The entity repository must be set'); } $this->serverProcessorService->setRepository($this->repository); return $this->serverProcessorService->findBy($criteria, $orderBy, $limit, $offset); }
/** * testFindByCallsProcessor * */ public function testFindByCallsProcessor() { $this->processor = Phake::mock('Brown298\\DataTablesBundle\\Service\\Processor\\RepositoryProcessor'); $this->service->setProcessor($this->processor); $this->service->findBy(array()); Phake::verify($this->processor)->buildFindBy(Phake::anyParameters()); }