1 | <?php |
||
9 | class XmlRendererTest extends PHPUnit_Framework_TestCase |
||
10 | { |
||
11 | public function testIntegrity() |
||
12 | { |
||
13 | // Environment |
||
14 | $contentToRender = file_get_contents(__DIR__ . '/examples/xml/mvc.xml'); |
||
15 | $resourceBasePath = __DIR__ . '/examples/xml/mvc'; |
||
16 | |||
17 | #$contentToRender = file_get_contents('./examples/xml/kaloa_renderer.xml'); |
||
18 | #$resourceBasePath = './examples/xml/kaloa_renderer'; |
||
19 | |||
20 | $config = new Config($resourceBasePath); |
||
21 | |||
22 | $renderer = Factory::createRenderer('xml', $config); |
||
23 | |||
24 | /* Simulate run of preSave hook */ |
||
25 | $contentToRender = $renderer->firePreSaveEvent($contentToRender); |
||
26 | |||
27 | $renderer->render($contentToRender); |
||
28 | |||
29 | $ctr = '<k:toc/> |
||
30 | <h2>Test</h2> |
||
31 | <h3>Foo</h3> |
||
32 | <img src="test.png" /> |
||
33 | <img src="http://test.png" /> |
||
34 | <a href="foo">link</a> |
||
35 | <a href="https://example.org">link</a> |
||
36 | <listing>1+1=2</listing> |
||
37 | <h4>Bar</h4> |
||
38 | <youtube id="dQw4w9WgXcQ" /> |
||
39 | <p>Test.<footnote>bla</footnote></p> |
||
40 | <h2>Quz</h2> |
||
41 | <p>Qux.<footnote><strong>Test</strong></footnote></p> |
||
42 | <p>Qix.<footnote name="x">Qix</footnote></p> |
||
43 | <p>Qaz.<footnote name="x">Qaz</footnote></p> |
||
44 | <p>Quz.<footnote name="x">Quz</footnote></p> |
||
45 | <p>Quz.<footnote name="fn:5">Quz</footnote></p> |
||
46 | <p>Quz.<footnote name="fn:6">Quz</footnote></p> |
||
47 | <p>Quz.<footnote name="fn:7">Quz</footnote></p> |
||
48 | <h3>Foo</h3> |
||
49 | <h4>Bar</h4>'; |
||
50 | |||
51 | $ctr = $renderer->firePreSaveEvent($ctr); |
||
52 | |||
53 | $renderer->render($ctr); |
||
54 | } |
||
55 | } |
||
56 |