/** * @return string */ public function toString() { $out = $this->leader; $out .= $this->tag; if ($this->parts != null) { $out .= $this->parts->toString(); } else { $out .= $this->body; } $out .= $this->end; if ($this->more != null) { $out .= $this->more->toString(); } else { $out .= $this->trailer; } return $out; }
public function testFractBody() { $p = PhpFit_Parse::create('leader<Table foo=2>0.5</table>trailer', array('table')); $this->assertEquals('leader', $p->leader); $this->assertEquals('<Table foo=2>', $p->tag); $this->assertEquals('0.5', $p->text()); $this->assertEquals('trailer', $p->trailer); }