From 862addacd51402cf99e3cb40caa94f9eade3031f Mon Sep 17 00:00:00 2001 From: Andreas Steiner Date: Mon, 29 Jul 2024 18:32:11 +0200 Subject: [PATCH 1/3] feat: #33454 Addition of a test to check the correct loading order --- tests/SettingsTest.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/SettingsTest.php b/tests/SettingsTest.php index dd78e34..3ca1403 100644 --- a/tests/SettingsTest.php +++ b/tests/SettingsTest.php @@ -129,7 +129,23 @@ class SettingsTest extends TestCase $this->assertEquals('site', $cfg->testFile); $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() From 09549adf2bda481a4470bc76a68f52f1259f92db Mon Sep 17 00:00:00 2001 From: Andreas Steiner Date: Mon, 29 Jul 2024 18:44:48 +0200 Subject: [PATCH 2/3] fix: #33454 Add missing files for the correct loading order test --- tests/cfg/order/config/conf.php | 5 +++++ tests/cfg/order/config/default.conf.php | 4 ++++ tests/cfg/order/config/site/conf.php | 4 ++++ 3 files changed, 13 insertions(+) create mode 100644 tests/cfg/order/config/conf.php create mode 100644 tests/cfg/order/config/default.conf.php create mode 100644 tests/cfg/order/config/site/conf.php diff --git a/tests/cfg/order/config/conf.php b/tests/cfg/order/config/conf.php new file mode 100644 index 0000000..8ea09df --- /dev/null +++ b/tests/cfg/order/config/conf.php @@ -0,0 +1,5 @@ + 1, + 'testFile' => 'conf', + 'testFiles2' => 'conf' +]; diff --git a/tests/cfg/order/config/default.conf.php b/tests/cfg/order/config/default.conf.php new file mode 100644 index 0000000..1cdaca9 --- /dev/null +++ b/tests/cfg/order/config/default.conf.php @@ -0,0 +1,4 @@ + 'prod', + 'testFiles' => 'default', +]; diff --git a/tests/cfg/order/config/site/conf.php b/tests/cfg/order/config/site/conf.php new file mode 100644 index 0000000..54ad2b8 --- /dev/null +++ b/tests/cfg/order/config/site/conf.php @@ -0,0 +1,4 @@ + 42, + 'testFile' => 'site' +]; From 270e64fa36ebbe80eba430968884659be42eaf11 Mon Sep 17 00:00:00 2001 From: Andreas Steiner Date: Mon, 29 Jul 2024 12:53:02 +0200 Subject: [PATCH 3/3] fix: #33454 Fix construct and load test --- tests/SettingsTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/SettingsTest.php b/tests/SettingsTest.php index 3ca1403..64ed411 100644 --- a/tests/SettingsTest.php +++ b/tests/SettingsTest.php @@ -30,7 +30,7 @@ class SettingsTest extends TestCase public function testConstruct() { $cfg = new Settings(); - $this->assertNotEmpty($cfg); + $this->assertIsObject($cfg); } /** @@ -69,7 +69,7 @@ class SettingsTest extends TestCase { $cfg = new Settings(); $cfg = $this->appPath($cfg)->load(); - $this->assertNotEmpty($cfg); + $this->assertIsObject($cfg); return $cfg; } @@ -240,4 +240,4 @@ class SettingsTest extends TestCase /* jEdit buffer local properties {{{ * :folding=explicit:collapseFolds=1: -}}}*/ \ No newline at end of file +}}}*/