File: ParseSimpleTest.php

package info (click to toggle)
php-roundcube-rtf-html-php 2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 276 kB
  • sloc: php: 1,277; makefile: 10
file content (28 lines) | stat: -rw-r--r-- 728 bytes parent folder | download | duplicates (2)
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
        );
    }
}