Exemplo n.º 1
0
 function testDoesNotParseAHeader()
 {
     $element = new T_Text_Header(4, '**content**');
     $element->accept(new T_Text_EmphLexer());
     $expected = new T_Text_Header(4, '**content**');
     $this->assertEquals($expected, $element);
 }
Exemplo n.º 2
0
 function testParsesAHeader()
 {
     $element = new T_Text_Header(4, '^2');
     $element->accept(new T_Text_SuperSubscriptLexer());
     $expected = new T_Text_Header(4, null);
     $expected->addChild(new T_Text_Superscript('2'));
     $this->assertEquals($expected, $element);
 }
Exemplo n.º 3
0
 function testLeavesHeaderContentAlone()
 {
     $text = T_Text_List::UNORDERED . ' Item #1';
     $header = new T_Text_Header(3, $text);
     $expect = clone $header;
     $header->accept(new T_Text_ListLexer());
     $this->assertEquals($expect, $header);
 }
Exemplo n.º 4
0
 function testParsesAHeader()
 {
     $element = new T_Text_Header(4, '[http://example.com content]');
     $element->accept(new T_Text_LinkLexer());
     $expected = new T_Text_Header(4, null);
     $expected->addChild(new T_Text_ExternalLink('content', 'http://example.com'));
     $this->assertEquals($expected, $element);
 }
Exemplo n.º 5
0
 function testThatHeaderChildrenRemainUnaffected()
 {
     $element = new T_Text_Header(2, "title");
     $element->addChild(new T_Text_Plain('some text'));
     $expect = new T_Text_Header(2, "title");
     $expect->addChild(new T_Text_Plain('some text'));
     $element->accept(new T_Text_ParagraphLexer());
     $this->assertEquals($expect, $element);
 }