xref: /dokuwiki/_test/tests/conf/CascadeNormalTest.php (revision 591ebe4523e0e3be14097d6d097eb5796628dcba)
1<?php
2
3class CascadeNormalTest extends DokuWikiTest {
4
5    public function setUp() : void {
6        $this->pluginsEnabled = [
7            'testing'
8        ];
9
10        parent::setUp();
11    }
12
13    public function testDefaults()
14    {
15        global $conf;
16
17        $this->assertEquals('start', $conf['start'], 'default value');
18        $this->assertEquals('', $conf['tagline'], 'default value');
19
20        $this->assertFalse(isset($conf['plugin']['testing']['schnibble']), 'not set before plugin call');
21
22        $testing = plugin_load('action', 'testing');
23        $this->assertEquals(0, $testing->getConf('schnibble'), 'default value');
24    }
25
26    public function testLocal() {
27        global $conf;
28
29        $this->assertEquals('My Test Wiki', $conf['title'], 'overriden in local.php (values from Config manager)');
30
31        $testing = plugin_load('action', 'testing');
32        $this->assertEquals('Local setting', $testing->getConf('second'), 'overriden in local.php');
33    }
34}
35