@@ -30,7 +30,7 @@ protected function tearDown(): void
30
30
/**
31
31
* Shortcut for quickly defining services. The returned Definition object can be further modified if necessary.
32
32
*/
33
- protected function registerService (string $ serviceId , string $ class ): Definition
33
+ final protected function registerService (string $ serviceId , string $ class ): Definition
34
34
{
35
35
$ definition = new Definition ($ class );
36
36
@@ -42,7 +42,7 @@ protected function registerService(string $serviceId, string $class): Definition
42
42
/**
43
43
* Set a service definition you manually created.
44
44
*/
45
- protected function setDefinition (string $ serviceId , Definition $ definition ): void
45
+ final protected function setDefinition (string $ serviceId , Definition $ definition ): void
46
46
{
47
47
$ this ->container ->setDefinition ($ serviceId , $ definition );
48
48
}
@@ -52,24 +52,26 @@ protected function setDefinition(string $serviceId, Definition $definition): voi
52
52
*
53
53
* @param mixed $parameterValue
54
54
*/
55
- protected function setParameter (string $ parameterId , $ parameterValue ): void
55
+ final protected function setParameter (string $ parameterId , $ parameterValue ): void
56
56
{
57
57
$ this ->container ->setParameter ($ parameterId , $ parameterValue );
58
58
}
59
59
60
60
/**
61
61
* Call this method to compile the ContainerBuilder, to test if any problems would occur at runtime.
62
62
*/
63
- protected function compile (): void
63
+ final protected function compile (): void
64
64
{
65
65
$ this ->container ->compile ();
66
66
}
67
67
68
68
/**
69
69
* Assert that the ContainerBuilder for this test has a service definition with the given id and class.
70
70
*/
71
- protected function assertContainerBuilderHasService (string $ serviceId , ?string $ expectedClass = null ): void
72
- {
71
+ final protected function assertContainerBuilderHasService (
72
+ string $ serviceId ,
73
+ ?string $ expectedClass = null
74
+ ): void {
73
75
$ checkExpectedClass = (func_num_args () > 1 );
74
76
75
77
self ::assertThat (
@@ -81,7 +83,7 @@ protected function assertContainerBuilderHasService(string $serviceId, ?string $
81
83
/**
82
84
* Assert that the ContainerBuilder for this test does not have a service definition with the given id.
83
85
*/
84
- protected function assertContainerBuilderNotHasService (string $ serviceId ): void
86
+ final protected function assertContainerBuilderNotHasService (string $ serviceId ): void
85
87
{
86
88
self ::assertThat (
87
89
$ this ->container ,
@@ -92,7 +94,7 @@ protected function assertContainerBuilderNotHasService(string $serviceId): void
92
94
/**
93
95
* Assert that the ContainerBuilder for this test has a synthetic service with the given id.
94
96
*/
95
- protected function assertContainerBuilderHasSyntheticService (string $ serviceId ): void
97
+ final protected function assertContainerBuilderHasSyntheticService (string $ serviceId ): void
96
98
{
97
99
self ::assertThat (
98
100
$ this ->container ,
@@ -103,8 +105,10 @@ protected function assertContainerBuilderHasSyntheticService(string $serviceId):
103
105
/**
104
106
* Assert that the ContainerBuilder for this test has an alias and that it is an alias for the given service id.
105
107
*/
106
- protected function assertContainerBuilderHasAlias (string $ aliasId , ?string $ expectedServiceId = null ): void
107
- {
108
+ final protected function assertContainerBuilderHasAlias (
109
+ string $ aliasId ,
110
+ ?string $ expectedServiceId = null
111
+ ): void {
108
112
self ::assertThat (
109
113
$ this ->container ,
110
114
new ContainerBuilderHasAliasConstraint ($ aliasId , $ expectedServiceId )
@@ -116,8 +120,10 @@ protected function assertContainerBuilderHasAlias(string $aliasId, ?string $expe
116
120
*
117
121
* @param mixed $expectedParameterValue
118
122
*/
119
- protected function assertContainerBuilderHasParameter (string $ parameterName , $ expectedParameterValue = null ): void
120
- {
123
+ final protected function assertContainerBuilderHasParameter (
124
+ string $ parameterName ,
125
+ $ expectedParameterValue = null
126
+ ): void {
121
127
$ checkParameterValue = (func_num_args () > 1 );
122
128
123
129
self ::assertThat (
@@ -132,7 +138,7 @@ protected function assertContainerBuilderHasParameter(string $parameterName, $ex
132
138
*
133
139
* @param mixed $expectedValue
134
140
*/
135
- protected function assertContainerBuilderHasServiceDefinitionWithArgument (
141
+ final protected function assertContainerBuilderHasServiceDefinitionWithArgument (
136
142
string $ serviceId ,
137
143
$ argumentIndex ,
138
144
$ expectedValue = null
@@ -153,7 +159,7 @@ protected function assertContainerBuilderHasServiceDefinitionWithArgument(
153
159
* @param int|string $argumentIndex
154
160
* @param array $expectedServiceMap an array of service-id references and their key in the map
155
161
*/
156
- protected function assertContainerBuilderHasServiceDefinitionWithServiceLocatorArgument (
162
+ final protected function assertContainerBuilderHasServiceDefinitionWithServiceLocatorArgument (
157
163
string $ serviceId ,
158
164
$ argumentIndex ,
159
165
array $ expectedValue
@@ -170,7 +176,7 @@ protected function assertContainerBuilderHasServiceDefinitionWithServiceLocatorA
170
176
*
171
177
* @param int|null $index
172
178
*/
173
- protected function assertContainerBuilderHasServiceDefinitionWithMethodCall (
179
+ final protected function assertContainerBuilderHasServiceDefinitionWithMethodCall (
174
180
string $ serviceId ,
175
181
string $ method ,
176
182
array $ arguments = [],
@@ -185,7 +191,7 @@ protected function assertContainerBuilderHasServiceDefinitionWithMethodCall(
185
191
* Assert that the ContainerBuilder for this test has a service definition with the given id, which has a tag
186
192
* with the given attributes.
187
193
*/
188
- protected function assertContainerBuilderHasServiceDefinitionWithTag (
194
+ final protected function assertContainerBuilderHasServiceDefinitionWithTag (
189
195
string $ serviceId ,
190
196
string $ tag ,
191
197
array $ attributes = []
@@ -199,8 +205,10 @@ protected function assertContainerBuilderHasServiceDefinitionWithTag(
199
205
* Assert that the ContainerBuilder for this test has a service definition with the given id which is a decorated
200
206
* service and it has the given parent service.
201
207
*/
202
- protected function assertContainerBuilderHasServiceDefinitionWithParent (string $ serviceId , string $ parentServiceId ): void
203
- {
208
+ final protected function assertContainerBuilderHasServiceDefinitionWithParent (
209
+ string $ serviceId ,
210
+ string $ parentServiceId
211
+ ): void {
204
212
$ definition = $ this ->container ->findDefinition ($ serviceId );
205
213
206
214
self ::assertThat ($ definition , new DefinitionIsChildOfConstraint ($ parentServiceId ));
@@ -211,8 +219,10 @@ protected function assertContainerBuilderHasServiceDefinitionWithParent(string $
211
219
*
212
220
* @param array $expectedServiceMap an array of service-id references and their key in the map
213
221
*/
214
- protected function assertContainerBuilderHasServiceLocator (string $ serviceId , array $ expectedServiceMap = []): void
215
- {
222
+ final protected function assertContainerBuilderHasServiceLocator (
223
+ string $ serviceId ,
224
+ array $ expectedServiceMap = []
225
+ ): void {
216
226
$ definition = $ this ->container ->findDefinition ($ serviceId );
217
227
218
228
// Service locator was provided as context (and therefor a factory)
0 commit comments