예제 #1
0
파일: Ortc.php 프로젝트: nikapps/ortc-php
 /**
  * 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();
 }
예제 #2
0
 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());
 }