/**
  * @param bool|true $cacheToken
  *
  * @return SegmentBillingRepository
  */
 protected function getSegmentBillingRepository($cacheToken = true)
 {
     $authClient = $this->getAuth($cacheToken);
     $segmentBillingRepository = new SegmentBillingRepository($authClient);
     $segmentBillingRepository->setBaseUrl(SegmentBillingRepository::SANDBOX_BASE_URL);
     return $segmentBillingRepository;
 }
 /**
  * @test
  */
 public function find_all_will_return_an_array_of_segments()
 {
     $client = $this->prophesize(Auth::class);
     $repository = new SegmentBillingRepository($client->reveal());
     $fakeResponse = $this->getFakeResponse($this->getMultipleBillingSegments());
     $client->request('GET', Argument::containingString('start_element=3'))->willReturn($fakeResponse)->shouldBeCalled();
     $segments = $repository->findAll('member_id', 3, 3);
     $this->assertNotEmpty($segments);
     foreach ($segments as $segment) {
         $this->assertInstanceOf(SegmentBilling::class, $segment);
     }
 }