Beispiel #1
0
 /**
  * get balancer url.
  *
  * @throws Exceptions\NetworkErrorException
  * @throws Exceptions\UnauthorizedException
  * @throws Exceptions\InvalidBalancerUrlException
  *
  * @return Models\Responses\BalancerUrlResponse
  */
 public function getBalancerUrl()
 {
     $this->baseUrl = null;
     $balancerUrlRequest = new BalancerUrlRequest();
     $balancerUrlRequest->setOrtcConfig($this->ortcConfig);
     $ortcClient = new OrtcClient();
     $ortcClient->setRequest($balancerUrlRequest);
     $ortcClient->setGuzzleClient($this->guzzleClient);
     return $ortcClient->execute();
 }
 public function testImplementsDefault()
 {
     $ortcConfig = new OrtcConfig();
     $ortcConfig->setApplicationKey('FOoB1r');
     $request = new BalancerUrlRequest();
     $request->setOrtcConfig($ortcConfig);
     $this->assertInstanceOf('Nikapps\\OrtcPhp\\Models\\Requests\\OrtcRequest', $request);
     $this->assertEquals('https://ortc-developers.realtime.co/server/2.1?appkey=FOoB1r', $request->getUrlPath());
     $this->assertFalse($request->isPost());
     $this->assertEquals([], $request->getPostData());
     $this->assertTrue($request->isUrlAbsolute());
     $this->assertInstanceOf('Nikapps\\OrtcPhp\\Handlers\\BalancerUrlResponseHandler', $request->getResponseHandler());
 }