1591ebe45SGerrit Uitslag<?php 2591ebe45SGerrit Uitslag 3*b54ce96cSAndreas Gohrnamespace dokuwiki\test\conf; 4*b54ce96cSAndreas Gohr 5*b54ce96cSAndreas Gohrclass CascadeNormalTest extends \DokuWikiTest 65d2c5d7eSGerrit Uitslag{ 7591ebe45SGerrit Uitslag 85d2c5d7eSGerrit Uitslag public function setUp(): void 95d2c5d7eSGerrit Uitslag { 10591ebe45SGerrit Uitslag $this->pluginsEnabled = [ 11591ebe45SGerrit Uitslag 'testing' 12591ebe45SGerrit Uitslag ]; 13591ebe45SGerrit Uitslag 14591ebe45SGerrit Uitslag parent::setUp(); 15591ebe45SGerrit Uitslag } 16591ebe45SGerrit Uitslag 17591ebe45SGerrit Uitslag public function testDefaults() 18591ebe45SGerrit Uitslag { 19591ebe45SGerrit Uitslag global $conf; 20591ebe45SGerrit Uitslag 21591ebe45SGerrit Uitslag $this->assertEquals('start', $conf['start'], 'default value'); 22591ebe45SGerrit Uitslag $this->assertEquals('', $conf['tagline'], 'default value'); 23591ebe45SGerrit Uitslag 24591ebe45SGerrit Uitslag $this->assertFalse(isset($conf['plugin']['testing']['schnibble']), 'not set before plugin call'); 25591ebe45SGerrit Uitslag 26591ebe45SGerrit Uitslag $testing = plugin_load('action', 'testing'); 27591ebe45SGerrit Uitslag $this->assertEquals(0, $testing->getConf('schnibble'), 'default value'); 28591ebe45SGerrit Uitslag } 29591ebe45SGerrit Uitslag 305d2c5d7eSGerrit Uitslag public function testLocal() 315d2c5d7eSGerrit Uitslag { 32591ebe45SGerrit Uitslag global $conf; 33591ebe45SGerrit Uitslag 34591ebe45SGerrit Uitslag $this->assertEquals('My Test Wiki', $conf['title'], 'overriden in local.php (values from Config manager)'); 35591ebe45SGerrit Uitslag 36591ebe45SGerrit Uitslag $testing = plugin_load('action', 'testing'); 37591ebe45SGerrit Uitslag $this->assertEquals('Local setting', $testing->getConf('second'), 'overriden in local.php'); 38591ebe45SGerrit Uitslag } 39591ebe45SGerrit Uitslag} 40