Ejemplo n.º 1
0
 /**
  * @expectedException Exception
  */
 public function testGetSetMethodException()
 {
     $object = new \stdClass();
     Utils::getSetMethod($object, 'unknown');
 }
 /**
  * Decorate url with a video
  *
  * @param Url $urlDecorated
  * @param type $thumnail_loc
  * @param type $title
  * @param type $description
  * @param array $parameters - the keys to use are the optional properties of this class, (e.g. 'player_loc' => 'http://acme.com/player.swf')
  * @throws Exception\GoogleVideoUrlException
  */
 public function __construct(Url $urlDecorated, $thumnail_loc, $title, $description, array $parameters = array())
 {
     foreach ($parameters as $key => $param) {
         $method = Utils::getSetMethod($this, $key);
         $this->{$method}($param);
     }
     $this->setThumbnailLoc($thumnail_loc);
     $this->setTitle($title);
     $this->setDescription($description);
     if (!$this->content_loc && !$this->player_loc) {
         throw new Exception\GoogleVideoUrlException('The parameter content_loc or player_loc is required');
     }
     if (count($this->platforms) && !$this->platform_relationship) {
         throw new Exception\GoogleVideoUrlException('The parameter platform_relationship is required when platform is set');
     }
     parent::__construct($urlDecorated);
 }