File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
tests/Foundation/Bootstrap Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Illuminate \Tests \Foundation \Bootstrap ;
4
4
5
+ use Illuminate \Filesystem \Filesystem ;
5
6
use Illuminate \Foundation \Application ;
6
7
use Illuminate \Foundation \Bootstrap \LoadConfiguration ;
7
8
use PHPUnit \Framework \TestCase ;
@@ -37,4 +38,23 @@ public function testLoadsConfigurationInIsolation()
37
38
$ this ->assertNull ($ app ['config ' ]['bar.foo ' ]);
38
39
$ this ->assertSame ('bar ' , $ app ['config ' ]['custom.foo ' ]);
39
40
}
41
+
42
+ public function testConfigurationArrayKeysMatchLoadedFilenames ()
43
+ {
44
+ $ baseConfigPath = __DIR__ .'/../../../config ' ;
45
+ $ customConfigPath = __DIR__ .'/../fixtures/config ' ;
46
+
47
+ $ app = new Application ();
48
+ $ app ->useConfigPath ($ customConfigPath );
49
+
50
+ (new LoadConfiguration )->bootstrap ($ app );
51
+
52
+ $ this ->assertEqualsCanonicalizing (
53
+ array_keys ($ app ['config ' ]->all ()),
54
+ collect ((new Filesystem )->files ([
55
+ $ baseConfigPath ,
56
+ $ customConfigPath ,
57
+ ]))->map (fn ($ file ) => $ file ->getBaseName ('.php ' ))->unique ()->values ()->toArray ()
58
+ );
59
+ }
40
60
}
You can’t perform that action at this time.
0 commit comments