@@ -23,32 +23,32 @@ class TestKernel extends Kernel
23
23
/**
24
24
* @var string[]
25
25
*/
26
- private $ bundlesToRegister = [];
26
+ private $ testBundle = [];
27
27
28
28
/**
29
29
* @var string[]|callable[]
30
30
*/
31
- private $ configs = [];
31
+ private $ testConfigs = [];
32
32
33
33
/**
34
34
* @var string
35
35
*/
36
- private $ cachePrefix ;
36
+ private $ testCachePrefix ;
37
37
38
38
/**
39
39
* @var string|null;
40
40
*/
41
- private $ fakedProjectDir ;
41
+ private $ testProjectDir ;
42
42
43
43
/**
44
44
* @var CompilerPassInterface[]
45
45
*/
46
- private $ compilerPasses = [];
46
+ private $ testCompilerPasses = [];
47
47
48
48
/**
49
49
* @var array<int, string>
50
50
*/
51
- private $ routingFiles = [];
51
+ private $ testRoutingFiles = [];
52
52
53
53
/**
54
54
* {@inheritDoc}
@@ -57,14 +57,14 @@ public function __construct(string $environment, bool $debug)
57
57
{
58
58
parent ::__construct ($ environment , $ debug );
59
59
60
- $ this ->cachePrefix = uniqid ('cache ' , true );
60
+ $ this ->testCachePrefix = uniqid ('cache ' , true );
61
61
62
- $ this ->addBundle (FrameworkBundle::class);
63
- $ this ->addConfig (__DIR__ .'/config/framework.yml ' );
62
+ $ this ->addTestBundle (FrameworkBundle::class);
63
+ $ this ->addTestConfig (__DIR__ .'/config/framework.yml ' );
64
64
if (class_exists (ConfigBuilderCacheWarmer::class)) {
65
- $ this ->addConfig (__DIR__ .'/config/framework-53.yml ' );
65
+ $ this ->addTestConfig (__DIR__ .'/config/framework-53.yml ' );
66
66
} else {
67
- $ this ->addConfig (__DIR__ .'/config/framework-52.yml ' );
67
+ $ this ->addTestConfig (__DIR__ .'/config/framework-52.yml ' );
68
68
}
69
69
}
70
70
@@ -73,22 +73,22 @@ public function __construct(string $environment, bool $debug)
73
73
*
74
74
* @param string $bundleClassName
75
75
*/
76
- public function addBundle ($ bundleClassName ): void
76
+ public function addTestBundle ($ bundleClassName ): void
77
77
{
78
- $ this ->bundlesToRegister [] = $ bundleClassName ;
78
+ $ this ->testBundle [] = $ bundleClassName ;
79
79
}
80
80
81
81
/**
82
82
* @param string|callable $configFile path to a config file or a callable which get the {@see ContainerBuilder} as its first argument
83
83
*/
84
- public function addConfig ($ configFile ): void
84
+ public function addTestConfig ($ configFile ): void
85
85
{
86
- $ this ->configs [] = $ configFile ;
86
+ $ this ->testConfigs [] = $ configFile ;
87
87
}
88
88
89
89
public function getCacheDir (): string
90
90
{
91
- return realpath (sys_get_temp_dir ()).'/NyholmBundleTest/ ' .$ this ->cachePrefix ;
91
+ return realpath (sys_get_temp_dir ()).'/NyholmBundleTest/ ' .$ this ->testCachePrefix ;
92
92
}
93
93
94
94
public function getLogDir (): string
@@ -98,26 +98,26 @@ public function getLogDir(): string
98
98
99
99
public function getProjectDir (): string
100
100
{
101
- if (null === $ this ->fakedProjectDir ) {
101
+ if (null === $ this ->testProjectDir ) {
102
102
return realpath (__DIR__ .'/../../../../ ' );
103
103
}
104
104
105
- return $ this ->fakedProjectDir ;
105
+ return $ this ->testProjectDir ;
106
106
}
107
107
108
108
/**
109
109
* @param string|null $projectDir
110
110
*/
111
- public function setProjectDir ($ projectDir ): void
111
+ public function setTestProjectDir ($ projectDir ): void
112
112
{
113
- $ this ->fakedProjectDir = $ projectDir ;
113
+ $ this ->testProjectDir = $ projectDir ;
114
114
}
115
115
116
116
public function registerBundles (): iterable
117
117
{
118
- $ this ->bundlesToRegister = array_unique ($ this ->bundlesToRegister );
118
+ $ this ->testBundle = array_unique ($ this ->testBundle );
119
119
120
- foreach ($ this ->bundlesToRegister as $ bundle ) {
120
+ foreach ($ this ->testBundle as $ bundle ) {
121
121
yield new $ bundle ();
122
122
}
123
123
}
@@ -129,7 +129,7 @@ protected function buildContainer(): ContainerBuilder
129
129
{
130
130
$ container = parent ::buildContainer ();
131
131
132
- foreach ($ this ->compilerPasses as $ pass ) {
132
+ foreach ($ this ->testCompilerPasses as $ pass ) {
133
133
$ container ->addCompilerPass ($ pass );
134
134
}
135
135
@@ -139,17 +139,17 @@ protected function buildContainer(): ContainerBuilder
139
139
/**
140
140
* @param CompilerPassInterface $compilerPasses
141
141
*/
142
- public function addCompilerPass ($ compilerPasses ): void
142
+ public function addTestCompilerPass ($ compilerPasses ): void
143
143
{
144
- $ this ->compilerPasses [] = $ compilerPasses ;
144
+ $ this ->testCompilerPasses [] = $ compilerPasses ;
145
145
}
146
146
147
147
/**
148
148
* @param string $routingFile
149
149
*/
150
- public function addRoutingFile ($ routingFile ): void
150
+ public function addTestRoutingFile ($ routingFile ): void
151
151
{
152
- $ this ->routingFiles [] = $ routingFile ;
152
+ $ this ->testRoutingFiles [] = $ routingFile ;
153
153
}
154
154
155
155
public function handleOptions (array $ options ): void
@@ -165,7 +165,7 @@ public function handleOptions(array $options): void
165
165
*/
166
166
protected function configureContainer ($ container , $ loader ): void
167
167
{
168
- foreach ($ this ->configs as $ config ) {
168
+ foreach ($ this ->testConfigs as $ config ) {
169
169
$ loader ->load ($ config );
170
170
}
171
171
}
@@ -175,7 +175,7 @@ protected function configureContainer($container, $loader): void
175
175
*/
176
176
protected function configureRoutes ($ routes ): void
177
177
{
178
- foreach ($ this ->routingFiles as $ routingFile ) {
178
+ foreach ($ this ->testRoutingFiles as $ routingFile ) {
179
179
$ routes ->import ($ routingFile );
180
180
}
181
181
}
0 commit comments