Example #1
0
 public function testMessyTitleContent()
 {
     $tag = new SimpleTitleTag(array());
     $this->assertTrue($tag->expectEndTag());
     $tag->addContent('<b>Hello</b>');
     $tag->addContent('<em>World</em>');
     $this->assertEqual($tag->getText(), 'HelloWorld');
 }
Example #2
0
 function testStartValues() {
     $tag = new SimpleTitleTag(array("a" => "1", "b" => ""));
     $this->assertEqual($tag->getTagName(), "title");
     $this->assertIdentical($tag->getAttribute("a"), "1");
     $this->assertIdentical($tag->getAttribute("b"), true);
     $this->assertIdentical($tag->getAttribute("c"), false);
     $this->assertIdentical($tag->getContent(), "");
 }
Example #3
0
 public function testStartValuesWithoutAdditionalContent()
 {
     $tag = new SimpleTitleTag(array('a' => '1', 'b' => ''));
     $this->assertEqual($tag->getTagName(), 'title');
     $this->assertIdentical($tag->getAttribute('a'), '1');
     $this->assertIdentical($tag->getAttribute('b'), '');
     $this->assertIdentical($tag->getAttribute('c'), false);
     $this->assertIdentical($tag->getContent(), '');
 }
Example #4
0
 function testTitleSetting()
 {
     $title = new SimpleTitleTag(array());
     $title->addContent('Title');
     $page = new SimplePage(new MockSimpleHttpResponse());
     $page->AcceptTag($title);
     $this->assertEqual($page->getTitle(), 'Title');
 }