Exemple #1
0
    public function testParagraphs()
    {
        $html_text = new Html_Text("TestOne");
        $html_text->newParagraph();
        $this->assertEquals("", $html_text->currentParagraphStyle);
        $html_text->addText("Paragraph One");
        $this->assertEquals("Paragraph One", $html_text->currentParagraphContent);
        $html_text->newParagraph();
        $this->assertEquals("", $html_text->currentParagraphContent);
        $html_text->addText("Paragraph Two");
        $this->assertEquals("Paragraph Two", $html_text->currentParagraphContent);
        $html_text->newHeading1("Heading One");
        $this->assertEquals("", $html_text->currentParagraphContent);
        $html_text->newParagraph();
        $html_text->addText("Paragraph Three");
        $html = $html_text->getInnerHtml();
        $standard = <<<'EOD'
<p><span>Paragraph One</span></p>
<p><span>Paragraph Two</span></p>
<h1>Heading One</h1>
<p><span>Paragraph Three</span></p>
EOD;
        $this->assertEquals(trim($standard), trim($html));
    }
Exemple #2
0
 /**
  * This produces and saves the Fallout document.
  * $path: Path to the document.
  */
 public function produceFalloutDocument($path)
 {
     $fallout = new Html_Text(Locale_Translate::_("Fallout"));
     $fallout->newHeading1(Locale_Translate::_("Fallout"));
     foreach ($this->fallout as $line) {
         $fallout->newParagraph();
         $fallout->addText($line);
     }
     $fallout->save($path);
 }