示例#1
0
 /**
  * @param array $options
  * @param array $notifyParams
  *
  * @return EncodingResponse
  */
 public function addMedia($options, $notifyParams = [])
 {
     $baseSettings = ['format' => $this->config->getNotify()->getFormat(), 'notify_format' => $this->config->getNotify()->getFormat(), 'notify' => $this->routeAssembler->buildRoute($this->config->getNotify()->getNotifyRoute(), $notifyParams)];
     $options = array_merge($baseSettings, $options);
     $options['source'] = $this->routeAssembler->buildUrl($options['source']);
     $command = $this->client->getCommand('AddMedia', $options);
     return $this->runCommand($command);
 }
示例#2
0
 /**
  * @param       $route
  * @param array $params
  * @param array $options
  *
  * @return string
  */
 public function buildRoute($route, $params = [], $options = [])
 {
     $params['hash'] = $this->config->getHash();
     $options['name'] = $route;
     $options['force_canonical'] = true;
     $options['uri'] = $this->uri;
     return $this->router->assemble($params, $options);
 }
 /**
  * @return JsonModel
  */
 public function notifyAction()
 {
     $this->guardValidHash();
     $format = $this->config->getNotify()->getFormat();
     $rawData = $this->params()->fromPost($format);
     $data = $this->parseData($format, $rawData);
     $this->notifyService->notify($data);
     return new JsonModel(['success' => true]);
 }
 /**
  * @test
  */
 public function it_should_convert_config_to_options()
 {
     $this->assertEquals($this->config->getApi()->getUserId(), 'userid');
     $this->assertEquals($this->config->getApi()->getUserKey(), 'userkey');
     $this->assertEquals($this->config->getNotify()->getFormat(), 'xml');
     $this->assertEquals($this->config->getNotify()->getNotifyRoute(), 'encodingcom/notify');
     $this->assertEquals($this->config->getNotify()->getNotifyService(), 'custom-notify-service-key');
     $this->assertEquals($this->config->getLocalTunnel()->isEnabled(), false);
     $this->assertEquals($this->config->getLocalTunnel()->getHost(), 'subdomain.ngrok.com');
     $this->assertEquals($this->config->getHash(), 'hash');
 }