/** * @testdox findAll() respects given restrictions */ public function testFindAllRestricted() { $this->dataMapper->expects($this->once())->method('findAll'); $this->collectionFinder->expects($this->once())->method('with')->with('key', Operator::EQUAL, 'value'); $this->repo->restrictTo('key', Operator::EQUAL, 'value'); /** @noinspection PhpUnusedLocalVariableInspection */ $article = $this->repo->findAll()->getItems(); }
/** * Retrieves the selected records. * * @param CollectionFinderInterface $finder The finder * * @return object[] */ protected function getRecords($finder) { $records = $finder->getItems(); if (empty($records)) { throw new NoRecordsException("No matching records found"); } return $records; }