public function testRenderWithAttribution() { $analytics = Pullquote::create()->appendText(Bold::create()->appendText('Some'))->appendText(' text to be ')->appendText(Italic::create()->appendText('within'))->appendText(' an ')->appendText(Italic::create()->appendText('aside'))->appendText(' for ')->appendText(Bold::create()->appendText('testing.'))->withAttribution('Some attribution'); $expected = '<aside>' . '<b>Some</b> text to be <i>within</i> an <i>aside</i> for <b>testing.</b>' . '<cite>Some attribution</cite>' . '</aside>'; $rendered = $analytics->render(); $this->assertEquals($expected, $rendered); }
public function testRenderWithNestedFormattedText() { $cite = Cite::create()->appendText(Bold::create()->appendText('Some ')->appendText(Italic::create()->appendText('nested formatting'))->appendText('.')); $expected = '<cite>' . '<b>Some <i>nested formatting</i>.</b>' . '</cite>'; $rendered = $cite->render(); $this->assertEquals($expected, $rendered); }
public function testRenderWithBoldStrongItalicEm() { $blockquote = Blockquote::create()->appendText(Bold::create()->appendText('Some'))->appendText(' text to be ')->appendText(Italic::create()->appendText('within'))->appendText(' a ')->appendText(Italic::create()->appendText('blockquote'))->appendText(' for ')->appendText(Bold::create()->appendText('testing.')); $expected = '<blockquote>' . '<b>Some</b> text to be <i>within</i> a <i>blockquote</i> for <b>testing.</b>' . '</blockquote>'; $rendered = $blockquote->render(); $this->assertEquals($expected, $rendered); }
public function testHeaderWithSponsor() { $header = Header::create()->withTitle(H1::create()->appendText('Big Top Title ')->appendText(Bold::create()->appendText('in Bold')))->withSubTitle(H2::create()->appendText('Smaller SubTitle ')->appendText(Bold::create()->appendText('in Bold')))->withKicker(H3::create()->appendText('Kicker ')->appendText(Bold::create()->appendText('in Bold')))->withSponsor(Sponsor::create()->withPageUrl('http://facebook.com/my-sponsor')); $expected = '<header>' . '<h1>Big Top Title <b>in Bold</b></h1>' . '<h2>Smaller SubTitle <b>in Bold</b></h2>' . '<h3 class="op-kicker">Kicker <b>in Bold</b></h3>' . '<ul class="op-sponsors">' . '<li>' . '<a href="http://facebook.com/my-sponsor" rel="facebook"></a>' . '</li>' . '</ul>' . '</header>'; $rendered = $header->render(); $this->assertEquals($expected, $rendered); }
public function testRenderEmptyFormatted() { $h1 = H1::create()->appendText(Bold::create()->appendText(' ')); $expected = ''; $rendered = $h1->render(); $this->assertEquals($expected, $rendered); }