1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
<?php
use PHPUnit\Framework\TestCase;
use RtfHtmlPhp\Document;
use RtfHtmlPhp\Html\HtmlFormatter;
class ParseSimpleTest extends TestCase
{
public function testParseSimple()
{
$rtf = file_get_contents("tests/rtf/hello-world.rtf");
$document = new Document($rtf);
$this->assertTrue(true);
}
public function testParseSimpleHtml()
{
$rtf = file_get_contents("tests/rtf/hello-world.rtf");
$document = new Document($rtf);
$formatter = new HtmlFormatter();
$html = $formatter->format($document);
$this->assertEquals(
'<p><span style="font-family:Calibri;font-size:15px;">Hello, world.</span></p>',
$html
);
}
}
|