xref: /dokuwiki/_test/tests/inc/parser/parser.inc.php (revision be906b566b9bdfd92c032ee07c4fd077d820a8d1)
1<?php
2
3require_once DOKU_INC . 'inc/parser/parser.php';
4require_once DOKU_INC . 'inc/parser/handler.php';
5if (!defined('DOKU_PARSER_EOL')) define('DOKU_PARSER_EOL', "\n");   // add this to make handling test cases simpler
6
7abstract class TestOfDoku_Parser extends DokuWikiTest {
8
9    /** @var  Doku_Parser */
10    protected $P;
11    /** @var  Doku_Handler */
12    protected $H;
13
14    function setUp() {
15        parent::setUp();
16        $this->H = new Doku_Handler();
17        $this->P = new Doku_Parser($this->H);
18    }
19
20    function tearDown() {
21        unset($this->P);
22        unset($this->H);
23    }
24}
25
26function stripByteIndex($call) {
27    unset($call[2]);
28    if ($call[0] == "nest") {
29      $call[1][0] = array_map('stripByteIndex',$call[1][0]);
30    }
31    return $call;
32}
33