public function testFindThumbnail() { $data = array("author_name" => "Some User", "author_url" => null, "provider_url" => "https://www.facebook.com", "provider_name" => "Facebook", "success" => true, "height" => null, "html" => "<div />", "type" => "rich", "version" => "1.0", "url" => "https://www.facebook.com/someuser/posts/6465132161654421654", "width" => 552); // Test facebook url $result = new Oembed_Result('https://www.facebook.com/someuser/posts/6465132161654421654'); $this->assertEquals("https://graph.facebook.com/6465132161654421654/picture", $result->findThumbnail($data)); // Test respect existing url $data['thumbnail_url'] = 'http://www.silverstripe.com/picture.jpg'; $this->assertEquals("http://www.silverstripe.com/picture.jpg", $result->findThumbnail($data)); }
public function __construct($url, $origin = false, $type = false, array $options = array()) { parent::__construct($url, $origin, $type, $options); $this->extraClass = array(); if (isset($options['class'])) { $this->extraClass[$options['class']] = true; } }
public function __construct($url, $origin = false, $type = false, array $options = array()) { parent::__construct($url, $origin, $type, $options); $this->_useLightbox = isset($options['lightbox']) && ($options['lightbox'] === true || $options['lightbox'] == 'true'); $this->extraClass = array(); if (isset($options['class'])) { $this->extraClass[$options['class']] = true; } }