public function addText(SimpleToken $text, $parent = null) { if ($parent) { $parent->addChild($text->getValue()); } else { parent::push($text->getValue()); } }
public function testGetValueAndType() { $simpleToken = new SimpleToken(Token::T_TEXT, '<p>Thiago</p>'); $this->assertSame(Token::T_TEXT, $simpleToken->getType()); $this->assertSame('<p>Thiago</p>', $simpleToken->getValue()); }