public function testRenderWithWidthAndHeight() { $social_embed = SocialEmbed::create()->withSource('http://foo.com')->withWidth(640)->withHeight(480); $expected = '<figure class="op-interactive">' . '<iframe src="http://foo.com" width="640" height="480"></iframe>' . '</figure>'; $rendered = $social_embed->render(); $this->assertEquals($expected, $rendered); }
/** * Adds new child elements to the front of this InstantArticle * * @param Element to be added to this Article. * * @return $this */ public function unshiftChild($child) { Type::enforce($child, [Ad::getClassName(), Analytics::getClassName(), AnimatedGIF::getClassName(), Audio::getClassName(), Blockquote::getClassName(), Image::getClassName(), H1::getClassName(), H2::getClassName(), Interactive::getClassName(), ListElement::getClassName(), Map::getClassName(), Paragraph::getClassName(), Pullquote::getClassName(), RelatedArticles::getClassName(), Slideshow::getClassName(), SocialEmbed::getClassName(), Video::getClassName()]); array_unshift($this->children, $child); return $this; }