createUser(['ROLE_DOCTOR']); $doctor = new Doctor($owner, 'دکتر تست'); $this->em->persist($doctor); $this->em->flush(); for ($i = 0; $i < 7; $i++) { $this->em->persist(new Claim('doctor', $doctor->getId(), 1, 'base')); } $this->em->flush(); $body = $this->authJson('GET', '/api/v1/billing/claims?limit=5', $owner); $this->assertSame(200, $this->responseCode()); $this->assertCount(5, $body['data']['data']); $this->assertSame(7, $body['data']['meta']['totalRecords']); $this->assertSame(2, $body['data']['meta']['totalPages']); $page2 = $this->authJson('GET', '/api/v1/billing/claims?limit=5&page=2', $owner); $this->assertCount(2, $page2['data']['data']); } }