/** * @When /^I list (\d+) page of books paginated by (\d+) books on page$/ */ public function iListPageOfBooksPaginatedByBooksOnPage($page, $booksPerPage) { $this->project(function () use($page, $booksPerPage) { return $this->library->listOfBooks($page, $booksPerPage); }); }
/** * @param Request $request * @return JsonResponse */ public function getBooksAction(Request $request) { return new JsonResponse($this->library->listOfBooks($request->query->get('page', 1), $request->query->get('booksPerPage'))); }