13
13
14
14
use PHPUnit \Framework \TestCase ;
15
15
use Symfony \Component \OptionsResolver \Debug \OptionsResolverIntrospector ;
16
+ use Symfony \Component \OptionsResolver \Exception \NoConfigurationException ;
17
+ use Symfony \Component \OptionsResolver \Exception \UndefinedOptionsException ;
16
18
use Symfony \Component \OptionsResolver \Options ;
17
19
use Symfony \Component \OptionsResolver \OptionsResolver ;
18
20
@@ -38,7 +40,7 @@ public function testGetDefaultNull()
38
40
39
41
public function testGetDefaultThrowsOnNoConfiguredValue ()
40
42
{
41
- $ this ->expectException (\ Symfony \ Component \ OptionsResolver \ Exception \ NoConfigurationException::class);
43
+ $ this ->expectException (NoConfigurationException::class);
42
44
$ this ->expectExceptionMessage ('No default value was set for the "foo" option. ' );
43
45
$ resolver = new OptionsResolver ();
44
46
$ resolver ->setDefined ($ option = 'foo ' );
@@ -49,7 +51,7 @@ public function testGetDefaultThrowsOnNoConfiguredValue()
49
51
50
52
public function testGetDefaultThrowsOnNotDefinedOption ()
51
53
{
52
- $ this ->expectException (\ Symfony \ Component \ OptionsResolver \ Exception \ UndefinedOptionsException::class);
54
+ $ this ->expectException (UndefinedOptionsException::class);
53
55
$ this ->expectExceptionMessage ('The option "foo" does not exist. ' );
54
56
$ resolver = new OptionsResolver ();
55
57
@@ -69,7 +71,7 @@ public function testGetLazyClosures()
69
71
70
72
public function testGetLazyClosuresThrowsOnNoConfiguredValue ()
71
73
{
72
- $ this ->expectException (\ Symfony \ Component \ OptionsResolver \ Exception \ NoConfigurationException::class);
74
+ $ this ->expectException (NoConfigurationException::class);
73
75
$ this ->expectExceptionMessage ('No lazy closures were set for the "foo" option. ' );
74
76
$ resolver = new OptionsResolver ();
75
77
$ resolver ->setDefined ($ option = 'foo ' );
@@ -80,7 +82,7 @@ public function testGetLazyClosuresThrowsOnNoConfiguredValue()
80
82
81
83
public function testGetLazyClosuresThrowsOnNotDefinedOption ()
82
84
{
83
- $ this ->expectException (\ Symfony \ Component \ OptionsResolver \ Exception \ UndefinedOptionsException::class);
85
+ $ this ->expectException (UndefinedOptionsException::class);
84
86
$ this ->expectExceptionMessage ('The option "foo" does not exist. ' );
85
87
$ resolver = new OptionsResolver ();
86
88
@@ -100,7 +102,7 @@ public function testGetAllowedTypes()
100
102
101
103
public function testGetAllowedTypesThrowsOnNoConfiguredValue ()
102
104
{
103
- $ this ->expectException (\ Symfony \ Component \ OptionsResolver \ Exception \ NoConfigurationException::class);
105
+ $ this ->expectException (NoConfigurationException::class);
104
106
$ this ->expectExceptionMessage ('No allowed types were set for the "foo" option. ' );
105
107
$ resolver = new OptionsResolver ();
106
108
$ resolver ->setDefined ($ option = 'foo ' );
@@ -111,7 +113,7 @@ public function testGetAllowedTypesThrowsOnNoConfiguredValue()
111
113
112
114
public function testGetAllowedTypesThrowsOnNotDefinedOption ()
113
115
{
114
- $ this ->expectException (\ Symfony \ Component \ OptionsResolver \ Exception \ UndefinedOptionsException::class);
116
+ $ this ->expectException (UndefinedOptionsException::class);
115
117
$ this ->expectExceptionMessage ('The option "foo" does not exist. ' );
116
118
$ resolver = new OptionsResolver ();
117
119
@@ -131,7 +133,7 @@ public function testGetAllowedValues()
131
133
132
134
public function testGetAllowedValuesThrowsOnNoConfiguredValue ()
133
135
{
134
- $ this ->expectException (\ Symfony \ Component \ OptionsResolver \ Exception \ NoConfigurationException::class);
136
+ $ this ->expectException (NoConfigurationException::class);
135
137
$ this ->expectExceptionMessage ('No allowed values were set for the "foo" option. ' );
136
138
$ resolver = new OptionsResolver ();
137
139
$ resolver ->setDefined ($ option = 'foo ' );
@@ -142,7 +144,7 @@ public function testGetAllowedValuesThrowsOnNoConfiguredValue()
142
144
143
145
public function testGetAllowedValuesThrowsOnNotDefinedOption ()
144
146
{
145
- $ this ->expectException (\ Symfony \ Component \ OptionsResolver \ Exception \ UndefinedOptionsException::class);
147
+ $ this ->expectException (UndefinedOptionsException::class);
146
148
$ this ->expectExceptionMessage ('The option "foo" does not exist. ' );
147
149
$ resolver = new OptionsResolver ();
148
150
@@ -162,7 +164,7 @@ public function testGetNormalizer()
162
164
163
165
public function testGetNormalizerThrowsOnNoConfiguredValue ()
164
166
{
165
- $ this ->expectException (\ Symfony \ Component \ OptionsResolver \ Exception \ NoConfigurationException::class);
167
+ $ this ->expectException (NoConfigurationException::class);
166
168
$ this ->expectExceptionMessage ('No normalizer was set for the "foo" option. ' );
167
169
$ resolver = new OptionsResolver ();
168
170
$ resolver ->setDefined ($ option = 'foo ' );
@@ -173,7 +175,7 @@ public function testGetNormalizerThrowsOnNoConfiguredValue()
173
175
174
176
public function testGetNormalizerThrowsOnNotDefinedOption ()
175
177
{
176
- $ this ->expectException (\ Symfony \ Component \ OptionsResolver \ Exception \ UndefinedOptionsException::class);
178
+ $ this ->expectException (UndefinedOptionsException::class);
177
179
$ this ->expectExceptionMessage ('The option "foo" does not exist. ' );
178
180
$ resolver = new OptionsResolver ();
179
181
@@ -194,7 +196,7 @@ public function testGetNormalizers()
194
196
195
197
public function testGetNormalizersThrowsOnNoConfiguredValue ()
196
198
{
197
- $ this ->expectException (\ Symfony \ Component \ OptionsResolver \ Exception \ NoConfigurationException::class);
199
+ $ this ->expectException (NoConfigurationException::class);
198
200
$ this ->expectExceptionMessage ('No normalizer was set for the "foo" option. ' );
199
201
$ resolver = new OptionsResolver ();
200
202
$ resolver ->setDefined ('foo ' );
@@ -205,7 +207,7 @@ public function testGetNormalizersThrowsOnNoConfiguredValue()
205
207
206
208
public function testGetNormalizersThrowsOnNotDefinedOption ()
207
209
{
208
- $ this ->expectException (\ Symfony \ Component \ OptionsResolver \ Exception \ UndefinedOptionsException::class);
210
+ $ this ->expectException (UndefinedOptionsException::class);
209
211
$ this ->expectExceptionMessage ('The option "foo" does not exist. ' );
210
212
$ resolver = new OptionsResolver ();
211
213
@@ -235,7 +237,7 @@ public function testGetClosureDeprecationMessage()
235
237
236
238
public function testGetDeprecationMessageThrowsOnNoConfiguredValue ()
237
239
{
238
- $ this ->expectException (\ Symfony \ Component \ OptionsResolver \ Exception \ NoConfigurationException::class);
240
+ $ this ->expectException (NoConfigurationException::class);
239
241
$ this ->expectExceptionMessage ('No deprecation was set for the "foo" option. ' );
240
242
$ resolver = new OptionsResolver ();
241
243
$ resolver ->setDefined ('foo ' );
@@ -246,7 +248,7 @@ public function testGetDeprecationMessageThrowsOnNoConfiguredValue()
246
248
247
249
public function testGetDeprecationMessageThrowsOnNotDefinedOption ()
248
250
{
249
- $ this ->expectException (\ Symfony \ Component \ OptionsResolver \ Exception \ UndefinedOptionsException::class);
251
+ $ this ->expectException (UndefinedOptionsException::class);
250
252
$ this ->expectExceptionMessage ('The option "foo" does not exist. ' );
251
253
$ resolver = new OptionsResolver ();
252
254
0 commit comments