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 ;
@@ -12,7 +13,7 @@ public function testLoadsBaseConfiguration()
12
13
{
13
14
$ app = new Application ();
14
15
15
- (new LoadConfiguration () )->bootstrap ($ app );
16
+ (new LoadConfiguration )->bootstrap ($ app );
16
17
17
18
$ this ->assertSame ('Laravel ' , $ app ['config ' ]['app.name ' ]);
18
19
}
@@ -22,7 +23,7 @@ public function testDontLoadBaseConfiguration()
22
23
$ app = new Application ();
23
24
$ app ->dontMergeFrameworkConfiguration ();
24
25
25
- (new LoadConfiguration () )->bootstrap ($ app );
26
+ (new LoadConfiguration )->bootstrap ($ app );
26
27
27
28
$ this ->assertNull ($ app ['config ' ]['app.name ' ]);
28
29
}
@@ -32,9 +33,25 @@ public function testLoadsConfigurationInIsolation()
32
33
$ app = new Application (__DIR__ .'/../fixtures ' );
33
34
$ app ->useConfigPath (__DIR__ .'/../fixtures/config ' );
34
35
35
- (new LoadConfiguration () )->bootstrap ($ app );
36
+ (new LoadConfiguration )->bootstrap ($ app );
36
37
37
38
$ this ->assertNull ($ app ['config ' ]['bar.foo ' ]);
38
39
$ this ->assertSame ('bar ' , $ app ['config ' ]['custom.foo ' ]);
39
40
}
41
+
42
+ public function testConfigurationKeysAlignWithLoadedFiles ()
43
+ {
44
+ $ app = new Application ();
45
+ $ app ->useConfigPath (__DIR__ .'/../fixtures/config ' );
46
+
47
+ (new LoadConfiguration )->bootstrap ($ app );
48
+
49
+ $ this ->assertEqualsCanonicalizing (
50
+ array_keys ($ app ['config ' ]->all ()),
51
+ collect ((new Filesystem )->files ([
52
+ __DIR__ .'/../../../config ' ,
53
+ __DIR__ .'/../fixtures/config ' ,
54
+ ]))->map (fn ($ file ) => $ file ->getBaseName ('.php ' ))->unique ()->values ()->toArray ()
55
+ );
56
+ }
40
57
}
0 commit comments