File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use PHPUnit \Framework \TestCase ;
4+ use RtfHtmlPhp \Document ;
5+ use RtfHtmlPhp \Html \HtmlFormatter ;
6+
7+ class ParseTest extends TestCase
8+ {
9+ public function testParse1 ()
10+ {
11+ $ rtf = file_get_contents ("tests/rtf/test1.rtf " );
12+ $ document = new Document ($ rtf );
13+ $ formatter = new HtmlFormatter ();
14+ $ html = $ formatter ->Format ($ document );
15+
16+ // We only test that it does not throw an exception
17+ $ this ->assertTrue (true );
18+ }
19+
20+ public function testParseException1 ()
21+ {
22+ $ this ->expectException (\Exception::class);
23+
24+ $ document = new Document ('{\rtf1\ansi\ansicpg1252\deff0\deflang1046 ' );
25+ $ formatter = new HtmlFormatter ();
26+ $ html = $ formatter ->Format ($ document );
27+ }
28+ }
Original file line number Diff line number Diff line change 1+ { \rtf 1 \ansi\ansicpg 1252 \deff 0 \deflang 1046 { \fonttbl { \f 0 \fnil\fcharset 0 Microsoft Sans Serif;}}
2+ { \colortbl ;\red 0 \green 0 \blue 0 ;}
3+ {\* \generator Msftedit 5.41.21.2510;} \viewkind 4 \uc 1 \pard\cf 1 \f 0 \fs 16 Blusa Alongada decote V, manga longa.\par
4+ Shape contornando o corpo, aplica\'e7\'e3 o do s\'ed mbolo ROLAMO\'c7 A na lateral.\par
5+ Tecido de viscose e elastano com amaciamento ecol\'f3 gico que utiliza o \'f3 leo extra\'ed do da casca de arroz.\par
6+ Possui \'f3 timo caimento, \'e9 agrad\'e1 vel ao toque e resistente ao pilling.\par
7+ }
You can’t perform that action at this time.
0 commit comments