note preview
[grauphel.git] / tests / Lib / Converter / HtmlTest.php
1 <?php
2 require_once __DIR__ . '/../../../lib/converter/html.php';
3
4 class Lib_Converter_HtmlTest extends PHPUnit_Framework_TestCase
5 {
6     public function testConvert()
7     {
8         $input = file_get_contents(__DIR__ . '/../../data/formattest.tomboynotecontent');
9
10         $converter = new OCA\Grauphel\Lib\Converter\Html();
11         $output = $converter->convert($input);
12         $this->assertEquals(
13             file_get_contents(__DIR__ . '/../../data/formattest.html'),
14             $output
15         );
16     }
17
18     public function testXSS()
19     {
20         $input = file_get_contents(__DIR__ . '/../../data/xss.tomboynotecontent');
21
22         $converter = new OCA\Grauphel\Lib\Converter\Html();
23         $output = $converter->convert($input);
24         $this->assertEquals(
25             file_get_contents(__DIR__ . '/../../data/xss.html'),
26             $output
27         );
28     }
29 }
30 ?>