1<?php
2/**
3 * @group plugin_const
4 * @group plugins
5 */
6class plugin_const_calculation_test extends DokuWikiTest {
7
8    public function setup() {
9        $this->pluginsEnabled[] = 'const';
10        parent::setup();
11    }
12
13    public function test_math() {
14        saveWikiText('test:plugin_const:math',
15            '<const>'.DOKU_LF
16            .'value1=4'.DOKU_LF
17            .'formular=value1 * 10 +2'.DOKU_LF
18            .'result:formular'.DOKU_LF
19            .'</const>'.DOKU_LF
20            .'%%result%%'.DOKU_LF,
21            'setup for test');
22        $HTML = p_wiki_xhtml('test:plugin_const:math');
23        $this->assertTrue(strpos($HTML, '42') !== false, 'Calculation is 42');
24    }
25}
26