/** * @test */ public function find_all_will_return_an_array_of_segments() { $client = $this->prophesize(Auth::class); $repository = new SegmentRepository($client->reveal()); $id = '5012'; $fakeResponse = $this->getFakeResponse($this->getMultipleSegments()); $client->request('GET', Argument::containingString('start_element=3'))->willReturn($fakeResponse)->shouldBeCalled(); $segments = $repository->findAll('member_id', 3, 3); foreach ($segments as $segment) { $this->assertInstanceOf(Segment::class, $segment); } }
/** * @param int $start * @param int $maxResults * * @return array|mixed|null * @throws \Exception */ public function findAll($start = 0, $maxResults = 100) { return $this->segmentRepository->findAll($this->memberId, $start, $maxResults); }