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);
 }
示例#2
0
 public function testRenderWithNestedFormattedText()
 {
     $h3 = H3::create()->appendText(Bold::create()->appendText('Some ')->appendText(Italic::create()->appendText('nested formatting'))->appendText('.'));
     $expected = '<h3>' . '<b>Some <i>nested formatting</i>.</b>' . '</h3>';
     $rendered = $h3->render();
     $this->assertEquals($expected, $rendered);
 }