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); }
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); }
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); }