Example #1
0
 public function test_canUploadMovie()
 {
     $date = new \DateTime();
     $obj = new Create($this->getApiKey(), $this->getApiSecret());
     $obj->setAuthor('Author')->setDate($date)->setDescription('desc')->setTitle($this->getFileName())->setVideoFile($this->getMp4VideoFile())->setCustomParameters(array('custom1' => 'custom1'))->addTag('testtag_1');
     $response = $obj->send()->json();
     $this->validateResponse($response, 'from: test_canUploadMovie');
 }
Example #2
0
 public function test_canCreateDownloadUrl()
 {
     $date = new \DateTime();
     $videofile = file_get_contents($this->getMp4VideoFileUrl());
     $obj = new Create($this->getApiKey(), $this->getApiSecret());
     $obj->setAuthor('Author')->setDate($date)->setDescription('desc')->setLink('http://barfoo.com')->setTitle($this->getFileName())->setDownloadUrl($this->getMp4VideoFileUrl())->setMd5(md5($videofile))->isResumeable(true)->setSize(strlen($videofile))->addTag('testtag_1')->setTags(array('testtag_2', 'testtag_3'));
     $response = $obj->send();
     $url = parse_url($response->getEffectiveUrl());
     $values = array('author' => 'Author', 'date' => $date->getTimestamp(), 'description' => 'desc', 'title' => $this->getFileName(), 'tags' => 'testtag_1,testtag_2,testtag_3', 'download_url' => urlencode($this->getMp4VideoFileUrl()), 'link' => urlencode('http://barfoo.com'), 'md5' => md5($videofile), 'resumable' => 'True', 'size' => strlen($videofile));
     $this->checkUrlValues($url, $values);
     $this->checkUrl($obj, $url);
     $this->checkSignature($obj, $url);
     $this->validateResponse($response->json(), 'from: test_canCreateDownloadUrl');
 }
Example #3
0
 /**
  * @expectedException \InvalidArgumentException
  */
 public function test_CantSetBothDownloadAndVideo()
 {
     $obj = new Create($this->getApiKey(), $this->getApiSecret());
     $obj->setDownloadUrl('http://foobar.com')->setVideoFile($this->getMp4VideoFile())->send();
 }