public function testAppendTagWithContent() { $this->nodes->append(Tag::strong('content')); $this->assertEquals((string) $this->nodes, '<strong>content</strong>'); $this->assertEquals((string) $this->nodes->append(array(Tag::br(), 'append text')), '<strong>content</strong><br>append text'); }
public function testCodeFormat() { Tag::$codeFormat = true; $this->assertEquals((string) Tag::div()->addClass('span1'), '<div class="span1">' . PHP_EOL . '</div>' . PHP_EOL); $this->assertEquals((string) Tag::div('contents')->addClass('span1'), '<div class="span1">' . PHP_EOL . ' contents' . PHP_EOL . '</div>' . PHP_EOL); $this->assertEquals((string) Tag::br(), '<br>' . PHP_EOL); $this->assertEquals((string) Tag::div('contents'), '<div>' . PHP_EOL . ' contents' . PHP_EOL . '</div>' . PHP_EOL); $this->assertEquals((string) Tag::div(Tag::div(Tag::span('content'))), '<div>' . PHP_EOL . ' <div>' . PHP_EOL . ' <span>content</span>' . PHP_EOL . ' </div>' . PHP_EOL . '</div>' . PHP_EOL); $this->assertEquals((string) Tag::span(Tag::span(), Tag::span()), '<span><span></span><span></span></span>' . PHP_EOL); }