/** * 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()); }
/** * __call * * @param $method * @param $arguments * * @return mixed * @throws \Brown298\DataTablesBundle\Exceptions\ProcessorException */ public function __call($method, $arguments) { 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 call_user_func_array(array($this->serverProcessorService, $method), $arguments); }