xref: /dokuwiki/_test/tests/conf/CascadeNormalTest.php (revision 5d2c5d7e32d5b0d835d896a62533da6991c51291)
1591ebe45SGerrit Uitslag<?php
2591ebe45SGerrit Uitslag
3*5d2c5d7eSGerrit Uitslagclass CascadeNormalTest extends DokuWikiTest
4*5d2c5d7eSGerrit Uitslag{
5591ebe45SGerrit Uitslag
6*5d2c5d7eSGerrit Uitslag    public function setUp(): void
7*5d2c5d7eSGerrit Uitslag    {
8591ebe45SGerrit Uitslag        $this->pluginsEnabled = [
9591ebe45SGerrit Uitslag            'testing'
10591ebe45SGerrit Uitslag        ];
11591ebe45SGerrit Uitslag
12591ebe45SGerrit Uitslag        parent::setUp();
13591ebe45SGerrit Uitslag    }
14591ebe45SGerrit Uitslag
15591ebe45SGerrit Uitslag    public function testDefaults()
16591ebe45SGerrit Uitslag    {
17591ebe45SGerrit Uitslag        global $conf;
18591ebe45SGerrit Uitslag
19591ebe45SGerrit Uitslag        $this->assertEquals('start', $conf['start'], 'default value');
20591ebe45SGerrit Uitslag        $this->assertEquals('', $conf['tagline'], 'default value');
21591ebe45SGerrit Uitslag
22591ebe45SGerrit Uitslag        $this->assertFalse(isset($conf['plugin']['testing']['schnibble']), 'not set before plugin call');
23591ebe45SGerrit Uitslag
24591ebe45SGerrit Uitslag        $testing = plugin_load('action', 'testing');
25591ebe45SGerrit Uitslag        $this->assertEquals(0, $testing->getConf('schnibble'), 'default value');
26591ebe45SGerrit Uitslag    }
27591ebe45SGerrit Uitslag
28*5d2c5d7eSGerrit Uitslag    public function testLocal()
29*5d2c5d7eSGerrit Uitslag    {
30591ebe45SGerrit Uitslag        global $conf;
31591ebe45SGerrit Uitslag
32591ebe45SGerrit Uitslag        $this->assertEquals('My Test Wiki', $conf['title'], 'overriden in local.php (values from Config manager)');
33591ebe45SGerrit Uitslag
34591ebe45SGerrit Uitslag        $testing = plugin_load('action', 'testing');
35591ebe45SGerrit Uitslag        $this->assertEquals('Local setting', $testing->getConf('second'), 'overriden in local.php');
36591ebe45SGerrit Uitslag    }
37591ebe45SGerrit Uitslag}
38