/** * @test * @group bookservice */ public function should_return_empty_set_when_no_books_are_found() { $orgId = 1; $collection = new ArrayCollection(); $this->orgRepo->shouldReceive('organizationOfId')->with($orgId)->andReturn($this->klimtoren); $this->bookRepo->shouldReceive('all')->with($this->klimtoren)->andReturn($collection); $books = $this->bookService->all($orgId); $this->assertEmpty($books); }
public function index($orgId) { $books = $this->bookService->all($orgId); return $this->jsonResponse($books); }