Compare commits
No commits in common. "e72fa80d6378f84e8bd2a60d063c97a0c836ef53" and "942f8a4bde1b4b7e8e3d7d1d980acb2ad3d76dc0" have entirely different histories.
e72fa80d63
...
942f8a4bde
5 changed files with 7 additions and 39 deletions
|
|
@ -153,7 +153,7 @@ class Settings implements \Iterator, \Countable
|
||||||
|
|
||||||
// load local config without merging - we need it here for the mode
|
// load local config without merging - we need it here for the mode
|
||||||
$conf = $this->buildFileName();
|
$conf = $this->buildFileName();
|
||||||
$localConf = [];
|
$localConf = false;
|
||||||
if (file_exists($conf)) $localConf = require($conf);
|
if (file_exists($conf)) $localConf = require($conf);
|
||||||
|
|
||||||
// if a mode was set in the constructor do not overwrite it
|
// if a mode was set in the constructor do not overwrite it
|
||||||
|
|
@ -169,7 +169,7 @@ class Settings implements \Iterator, \Countable
|
||||||
$siteConf = $this->buildFileName(self::SITE);
|
$siteConf = $this->buildFileName(self::SITE);
|
||||||
if (file_exists($siteConf))
|
if (file_exists($siteConf))
|
||||||
{
|
{
|
||||||
$localConf = array_replace_recursive($localConf, require($siteConf));
|
$localConf = array_replace_recursive($this->settings, require($siteConf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ class SettingsTest extends TestCase
|
||||||
public function testConstruct()
|
public function testConstruct()
|
||||||
{
|
{
|
||||||
$cfg = new Settings();
|
$cfg = new Settings();
|
||||||
$this->assertIsObject($cfg);
|
$this->assertNotEmpty($cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -69,7 +69,7 @@ class SettingsTest extends TestCase
|
||||||
{
|
{
|
||||||
$cfg = new Settings();
|
$cfg = new Settings();
|
||||||
$cfg = $this->appPath($cfg)->load();
|
$cfg = $this->appPath($cfg)->load();
|
||||||
$this->assertIsObject($cfg);
|
$this->assertNotEmpty($cfg);
|
||||||
return $cfg;
|
return $cfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -130,22 +130,6 @@ class SettingsTest extends TestCase
|
||||||
$this->assertEquals(42, $cfg->answer);
|
$this->assertEquals(42, $cfg->answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public function testLoadingOrder()
|
|
||||||
{
|
|
||||||
$cfg = new Settings();
|
|
||||||
$cfg = $this->appPath($cfg, 'order')->site('site')->load();
|
|
||||||
|
|
||||||
$this->assertEquals('default', $cfg->testFiles);
|
|
||||||
$this->assertEquals('conf', $cfg->testFiles2);
|
|
||||||
$this->assertEquals('site', $cfg->testFile);
|
|
||||||
$this->assertEquals(42, $cfg->answer);
|
|
||||||
|
|
||||||
return $cfg;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public function testTestingOverride()
|
public function testTestingOverride()
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
<?php return [
|
|
||||||
'answer' => 1,
|
|
||||||
'testFile' => 'conf',
|
|
||||||
'testFiles2' => 'conf'
|
|
||||||
];
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
<?php return [
|
|
||||||
'mode' => 'prod',
|
|
||||||
'answer' => 0,
|
|
||||||
'testFile' => 'default',
|
|
||||||
'testFiles' => 'default',
|
|
||||||
'testFiles2' => 'default'
|
|
||||||
];
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
<?php return [
|
|
||||||
'answer' => 42,
|
|
||||||
'testFile' => 'site'
|
|
||||||
];
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue