4
4
5
5
use Matthias \SymfonyDependencyInjectionTest \PhpUnit \AbstractExtensionTestCase ;
6
6
use Matthias \SymfonyDependencyInjectionTest \Tests \Fixtures \MatthiasDependencyInjectionTestExtension ;
7
+ use PHPUnit \Framework \ExpectationFailedException ;
7
8
8
9
class AbstractExtensionTestCaseTest extends AbstractExtensionTestCase
9
10
{
@@ -57,7 +58,7 @@ public function if_service_is_undefined_it_fails()
57
58
{
58
59
$ this ->load ();
59
60
60
- $ this ->expectException (\PHPUnit_Framework_ExpectationFailedException ::class);
61
+ $ this ->expectException (ExpectationFailedException ::class);
61
62
62
63
$ this ->assertContainerBuilderHasService ('undefined ' , 'AnyClass ' );
63
64
}
@@ -69,7 +70,7 @@ public function if_synthetic_service_is_undefined_it_fails()
69
70
{
70
71
$ this ->load ();
71
72
72
- $ this ->expectException (\PHPUnit_Framework_ExpectationFailedException ::class);
73
+ $ this ->expectException (ExpectationFailedException ::class);
73
74
$ this ->expectExceptionMessage ('no service ' );
74
75
75
76
$ this ->assertContainerBuilderHasSyntheticService ('undefined ' );
@@ -82,7 +83,7 @@ public function if_service_is_defined_but_not_synthetic_it_fails()
82
83
{
83
84
$ this ->load ();
84
85
85
- $ this ->expectException (\PHPUnit_Framework_ExpectationFailedException ::class);
86
+ $ this ->expectException (ExpectationFailedException ::class);
86
87
$ this ->expectExceptionMessage ('synthetic ' );
87
88
88
89
$ this ->assertContainerBuilderHasSyntheticService ('loaded_service_id ' );
@@ -95,7 +96,7 @@ public function if_service_is_defined_but_has_another_class_it_fails()
95
96
{
96
97
$ this ->load ();
97
98
98
- $ this ->expectException (\PHPUnit_Framework_ExpectationFailedException ::class);
99
+ $ this ->expectException (ExpectationFailedException ::class);
99
100
$ this ->expectExceptionMessage ('stdClass ' );
100
101
101
102
$ this ->assertContainerBuilderHasService ('manual_service_id ' , 'SomeOtherClass ' );
@@ -108,7 +109,7 @@ public function if_alias_is_not_defined_it_fails()
108
109
{
109
110
$ this ->load ();
110
111
111
- $ this ->expectException (\PHPUnit_Framework_ExpectationFailedException ::class);
112
+ $ this ->expectException (ExpectationFailedException ::class);
112
113
113
114
$ this ->assertContainerBuilderHasAlias ('undefined ' , 'any_service_id ' );
114
115
}
@@ -120,7 +121,7 @@ public function if_alias_exists_but_for_wrong_service_it_fails()
120
121
{
121
122
$ this ->load ();
122
123
123
- $ this ->expectException (\PHPUnit_Framework_ExpectationFailedException ::class);
124
+ $ this ->expectException (ExpectationFailedException ::class);
124
125
$ this ->expectExceptionMessage ('service_id ' );
125
126
126
127
$ this ->assertContainerBuilderHasAlias ('manual_alias ' , 'wrong ' );
@@ -133,7 +134,7 @@ public function if_parameter_does_not_exist_it_fails()
133
134
{
134
135
$ this ->load ();
135
136
136
- $ this ->expectException (\PHPUnit_Framework_ExpectationFailedException ::class);
137
+ $ this ->expectException (ExpectationFailedException ::class);
137
138
$ this ->expectExceptionMessage ('undefined ' );
138
139
139
140
$ this ->assertContainerBuilderHasParameter ('undefined ' , 'any value ' );
@@ -146,7 +147,7 @@ public function if_parameter_exists_but_has_wrong_value_it_fails()
146
147
{
147
148
$ this ->load ();
148
149
149
- $ this ->expectException (\PHPUnit_Framework_ExpectationFailedException ::class);
150
+ $ this ->expectException (ExpectationFailedException ::class);
150
151
$ this ->expectExceptionMessage ('parameter value ' );
151
152
152
153
$ this ->assertContainerBuilderHasParameter ('manual_parameter ' , 'wrong ' );
@@ -159,7 +160,7 @@ public function if_definition_does_not_have_argument_it_fails()
159
160
{
160
161
$ this ->load ();
161
162
162
- $ this ->expectException (\PHPUnit_Framework_ExpectationFailedException ::class);
163
+ $ this ->expectException (ExpectationFailedException ::class);
163
164
$ this ->expectExceptionMessage ('10 ' );
164
165
165
166
$ this ->assertContainerBuilderHasServiceDefinitionWithArgument ('manual_service_id ' , 10 , 'any value ' );
@@ -172,7 +173,7 @@ public function if_definition_has_argument_but_with_wrong_value_it_fails()
172
173
{
173
174
$ this ->load ();
174
175
175
- $ this ->expectException (\PHPUnit_Framework_ExpectationFailedException ::class);
176
+ $ this ->expectException (ExpectationFailedException ::class);
176
177
177
178
$ this ->assertContainerBuilderHasServiceDefinitionWithArgument ('manual_service_id ' , 1 , 'wrong value ' );
178
179
}
@@ -184,7 +185,7 @@ public function if_definition_is_decorated_and_argument_has_wrong_value_it_fails
184
185
{
185
186
$ this ->load ();
186
187
187
- $ this ->expectException (\PHPUnit_Framework_ExpectationFailedException ::class);
188
+ $ this ->expectException (ExpectationFailedException ::class);
188
189
$ this ->expectExceptionMessage ('second argument ' );
189
190
190
191
$ this ->assertContainerBuilderHasServiceDefinitionWithArgument ('child_service_id ' , 1 , 'wrong value ' );
@@ -197,7 +198,7 @@ public function if_definition_is_decorated_but_by_the_wrong_parent_it_fails()
197
198
{
198
199
$ this ->load ();
199
200
200
- $ this ->expectException (\PHPUnit_Framework_ExpectationFailedException ::class);
201
+ $ this ->expectException (ExpectationFailedException ::class);
201
202
$ this ->expectExceptionMessage ('parent_service_id ' );
202
203
203
204
$ this ->assertContainerBuilderHasServiceDefinitionWithParent ('child_service_id ' , 'wrong_parent_service_id ' );
@@ -210,7 +211,7 @@ public function if_definition_should_be_decorated_when_it_is_not_it_fails()
210
211
{
211
212
$ this ->load ();
212
213
213
- $ this ->expectException (\PHPUnit_Framework_ExpectationFailedException ::class);
214
+ $ this ->expectException (ExpectationFailedException ::class);
214
215
$ this ->expectExceptionMessage ('parent ' );
215
216
216
217
$ this ->assertContainerBuilderHasServiceDefinitionWithParent ('parent_service_id ' , 'any_other_service_id ' );
@@ -223,7 +224,7 @@ public function if_definition_should_have_a_method_call_and_it_has_not_it_fails(
223
224
{
224
225
$ this ->load ();
225
226
226
- $ this ->expectException (\PHPUnit_Framework_ExpectationFailedException ::class);
227
+ $ this ->expectException (ExpectationFailedException ::class);
227
228
$ this ->expectExceptionMessage ('wrongMethodName ' );
228
229
229
230
$ this ->assertContainerBuilderHasServiceDefinitionWithMethodCall (
@@ -240,7 +241,7 @@ public function if_definition_should_have_a_certain_arguments_for_a_method_call_
240
241
{
241
242
$ this ->load ();
242
243
243
- $ this ->expectException (\PHPUnit_Framework_ExpectationFailedException ::class);
244
+ $ this ->expectException (ExpectationFailedException ::class);
244
245
$ this ->expectExceptionMessage ('theRightMethodName ' );
245
246
246
247
$ this ->assertContainerBuilderHasServiceDefinitionWithMethodCall (
@@ -257,7 +258,7 @@ public function if_service_is_defined_it_fails()
257
258
{
258
259
$ this ->load ();
259
260
260
- $ this ->expectException (\PHPUnit_Framework_ExpectationFailedException ::class);
261
+ $ this ->expectException (ExpectationFailedException ::class);
261
262
262
263
$ this ->assertContainerBuilderNotHasService ('loaded_service_id ' );
263
264
}
0 commit comments