xref: /dokuwiki/_test/tests/inc/parser/parser_file.test.php (revision e5d09fddcd17a2fe896650b64b81313a7d000975)
1<?php
2require_once 'parser.inc.php';
3
4class TestOfDoku_Parser_File extends TestOfDoku_Parser {
5
6    function setUp() {
7        parent::setUp();
8        $this->P->addMode('file',new Doku_Parser_Mode_File());
9    }
10
11    function testFile() {
12        $this->P->parse('Foo <file>Test</file> Bar');
13        $calls = array (
14            array('document_start',array()),
15            array('p_open',array()),
16            array('cdata',array("\n".'Foo ')),
17            array('p_close',array()),
18            array('file',array('Test',null,null)),
19            array('p_open',array()),
20            array('cdata',array(' Bar')),
21            array('p_close',array()),
22            array('document_end',array()),
23        );
24        $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
25    }
26
27}
28
29