コード例 #1
0
ファイル: textTest.php プロジェクト: alerque/bibledit
    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));
    }
コード例 #2
0
ファイル: text.php プロジェクト: alerque/bibledit
 /**
  * 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);
 }