Commit 84d74f7 1 parent 324f3f2 commit 84d74f7 Copy full SHA for 84d74f7
File tree 3 files changed +20
-8
lines changed
3 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 55
55
"psalm/plugin-phpunit" : " ^0.18.4" ,
56
56
"symfony/framework-bundle" : " ^6.4 || ^7.0" ,
57
57
"symfony/http-kernel" : " ^6.4 || ^7.0" ,
58
+ "symfony/runtime" : " ^6.4 || ^7.0" ,
58
59
"symfony/uid" : " ^6.4 || ^7.0" ,
59
60
"symfony/var-dumper" : " ^6.4 || ^7.0" ,
60
61
"symfony/yaml" : " ^6.4 || ^7.0" ,
73
74
}
74
75
},
75
76
"config" : {
76
- "sort-packages" : true
77
+ "sort-packages" : true ,
78
+ "allow-plugins" : {
79
+ "symfony/runtime" : true
80
+ }
77
81
}
78
82
}
Original file line number Diff line number Diff line change @@ -38,9 +38,12 @@ class TestKernel extends Kernel
38
38
/**
39
39
* @param array<string,mixed> $config
40
40
*/
41
- public function __construct (private array $ config = [])
42
- {
43
- parent ::__construct ('test ' , true );
41
+ public function __construct (
42
+ private array $ config = [],
43
+ string $ env = 'test ' ,
44
+ bool $ debug = true
45
+ ) {
46
+ parent ::__construct ($ env , $ debug );
44
47
}
45
48
46
49
public function registerBundles (): iterable
Original file line number Diff line number Diff line change @@ -17,8 +17,13 @@ namespace Rekalogika\Mapper\Tests;
17
17
use Rekalogika \Mapper \Tests \Common \TestKernel ;
18
18
use Symfony \Bundle \FrameworkBundle \Console \Application ;
19
19
20
- require_once __DIR__ . ' /../ vendor/autoload .php ' ;
20
+ require_once dirname ( __DIR__ ). ' / vendor/autoload_runtime .php ' ;
21
21
22
- $ kernel = new TestKernel ();
23
- $ application = new Application ($ kernel );
24
- $ application ->run ();
22
+ return function (array $ context ) {
23
+ $ env = $ context ['APP_ENV ' ] ?? 'test ' ;
24
+ assert (is_string ($ env ));
25
+
26
+ $ kernel = new TestKernel ([], $ env , (bool ) $ context ['APP_DEBUG ' ]);
27
+
28
+ return new Application ($ kernel );
29
+ };
You can’t perform that action at this time.
0 commit comments