/** * @param $orgId * @return ArrayCollection * @throws OrganizationNotFoundException */ public function all($orgId) { $organization = $this->orgRepo->organizationOfId($orgId); if (!$organization) { throw new OrganizationNotFoundException($orgId); } return $this->bookRepo->all($organization); }
/** * @test * @group bookrepo */ public function should_return_book_of_id() { $klimtoren = $this->getKlimtoren(); $books = $this->bookRepo->all($klimtoren); $tmp = $books[0]; $id = $tmp->id(); $this->em->clear(); $book = $this->bookRepo->bookOfId($id); $this->assertInstanceOf('Bakgat\\Notos\\Domain\\Model\\Resource\\Book', $book); $this->assertEquals('book 1', $book->name()->toString()); }