1212namespace Symfony \Component \OptionsResolver \Tests \Debug ;
1313
1414use PHPUnit \Framework \TestCase ;
15+ use Symfony \Bridge \PhpUnit \ForwardCompatTestTrait ;
1516use Symfony \Component \OptionsResolver \Debug \OptionsResolverIntrospector ;
1617use Symfony \Component \OptionsResolver \Options ;
1718use Symfony \Component \OptionsResolver \OptionsResolver ;
1819
1920class OptionsResolverIntrospectorTest extends TestCase
2021{
22+ use ForwardCompatTestTrait;
23+
2124 public function testGetDefault ()
2225 {
2326 $ resolver = new OptionsResolver ();
@@ -36,25 +39,21 @@ public function testGetDefaultNull()
3639 $ this ->assertNull ($ debug ->getDefault ($ option ));
3740 }
3841
39- /**
40- * @expectedException \Symfony\Component\OptionsResolver\Exception\NoConfigurationException
41- * @expectedExceptionMessage No default value was set for the "foo" option.
42- */
4342 public function testGetDefaultThrowsOnNoConfiguredValue ()
4443 {
44+ $ this ->expectException ('Symfony\Component\OptionsResolver\Exception\NoConfigurationException ' );
45+ $ this ->expectExceptionMessage ('No default value was set for the "foo" option. ' );
4546 $ resolver = new OptionsResolver ();
4647 $ resolver ->setDefined ($ option = 'foo ' );
4748
4849 $ debug = new OptionsResolverIntrospector ($ resolver );
4950 $ this ->assertSame ('bar ' , $ debug ->getDefault ($ option ));
5051 }
5152
52- /**
53- * @expectedException \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException
54- * @expectedExceptionMessage The option "foo" does not exist.
55- */
5653 public function testGetDefaultThrowsOnNotDefinedOption ()
5754 {
55+ $ this ->expectException ('Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException ' );
56+ $ this ->expectExceptionMessage ('The option "foo" does not exist. ' );
5857 $ resolver = new OptionsResolver ();
5958
6059 $ debug = new OptionsResolverIntrospector ($ resolver );
@@ -71,25 +70,21 @@ public function testGetLazyClosures()
7170 $ this ->assertSame ($ closures , $ debug ->getLazyClosures ($ option ));
7271 }
7372
74- /**
75- * @expectedException \Symfony\Component\OptionsResolver\Exception\NoConfigurationException
76- * @expectedExceptionMessage No lazy closures were set for the "foo" option.
77- */
7873 public function testGetLazyClosuresThrowsOnNoConfiguredValue ()
7974 {
75+ $ this ->expectException ('Symfony\Component\OptionsResolver\Exception\NoConfigurationException ' );
76+ $ this ->expectExceptionMessage ('No lazy closures were set for the "foo" option. ' );
8077 $ resolver = new OptionsResolver ();
8178 $ resolver ->setDefined ($ option = 'foo ' );
8279
8380 $ debug = new OptionsResolverIntrospector ($ resolver );
8481 $ this ->assertSame ('bar ' , $ debug ->getLazyClosures ($ option ));
8582 }
8683
87- /**
88- * @expectedException \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException
89- * @expectedExceptionMessage The option "foo" does not exist.
90- */
9184 public function testGetLazyClosuresThrowsOnNotDefinedOption ()
9285 {
86+ $ this ->expectException ('Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException ' );
87+ $ this ->expectExceptionMessage ('The option "foo" does not exist. ' );
9388 $ resolver = new OptionsResolver ();
9489
9590 $ debug = new OptionsResolverIntrospector ($ resolver );
@@ -106,25 +101,21 @@ public function testGetAllowedTypes()
106101 $ this ->assertSame ($ allowedTypes , $ debug ->getAllowedTypes ($ option ));
107102 }
108103
109- /**
110- * @expectedException \Symfony\Component\OptionsResolver\Exception\NoConfigurationException
111- * @expectedExceptionMessage No allowed types were set for the "foo" option.
112- */
113104 public function testGetAllowedTypesThrowsOnNoConfiguredValue ()
114105 {
106+ $ this ->expectException ('Symfony\Component\OptionsResolver\Exception\NoConfigurationException ' );
107+ $ this ->expectExceptionMessage ('No allowed types were set for the "foo" option. ' );
115108 $ resolver = new OptionsResolver ();
116109 $ resolver ->setDefined ($ option = 'foo ' );
117110
118111 $ debug = new OptionsResolverIntrospector ($ resolver );
119112 $ this ->assertSame ('bar ' , $ debug ->getAllowedTypes ($ option ));
120113 }
121114
122- /**
123- * @expectedException \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException
124- * @expectedExceptionMessage The option "foo" does not exist.
125- */
126115 public function testGetAllowedTypesThrowsOnNotDefinedOption ()
127116 {
117+ $ this ->expectException ('Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException ' );
118+ $ this ->expectExceptionMessage ('The option "foo" does not exist. ' );
128119 $ resolver = new OptionsResolver ();
129120
130121 $ debug = new OptionsResolverIntrospector ($ resolver );
@@ -141,25 +132,21 @@ public function testGetAllowedValues()
141132 $ this ->assertSame ($ allowedValues , $ debug ->getAllowedValues ($ option ));
142133 }
143134
144- /**
145- * @expectedException \Symfony\Component\OptionsResolver\Exception\NoConfigurationException
146- * @expectedExceptionMessage No allowed values were set for the "foo" option.
147- */
148135 public function testGetAllowedValuesThrowsOnNoConfiguredValue ()
149136 {
137+ $ this ->expectException ('Symfony\Component\OptionsResolver\Exception\NoConfigurationException ' );
138+ $ this ->expectExceptionMessage ('No allowed values were set for the "foo" option. ' );
150139 $ resolver = new OptionsResolver ();
151140 $ resolver ->setDefined ($ option = 'foo ' );
152141
153142 $ debug = new OptionsResolverIntrospector ($ resolver );
154143 $ this ->assertSame ('bar ' , $ debug ->getAllowedValues ($ option ));
155144 }
156145
157- /**
158- * @expectedException \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException
159- * @expectedExceptionMessage The option "foo" does not exist.
160- */
161146 public function testGetAllowedValuesThrowsOnNotDefinedOption ()
162147 {
148+ $ this ->expectException ('Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException ' );
149+ $ this ->expectExceptionMessage ('The option "foo" does not exist. ' );
163150 $ resolver = new OptionsResolver ();
164151
165152 $ debug = new OptionsResolverIntrospector ($ resolver );
@@ -176,25 +163,21 @@ public function testGetNormalizer()
176163 $ this ->assertSame ($ normalizer , $ debug ->getNormalizer ($ option ));
177164 }
178165
179- /**
180- * @expectedException \Symfony\Component\OptionsResolver\Exception\NoConfigurationException
181- * @expectedExceptionMessage No normalizer was set for the "foo" option.
182- */
183166 public function testGetNormalizerThrowsOnNoConfiguredValue ()
184167 {
168+ $ this ->expectException ('Symfony\Component\OptionsResolver\Exception\NoConfigurationException ' );
169+ $ this ->expectExceptionMessage ('No normalizer was set for the "foo" option. ' );
185170 $ resolver = new OptionsResolver ();
186171 $ resolver ->setDefined ($ option = 'foo ' );
187172
188173 $ debug = new OptionsResolverIntrospector ($ resolver );
189174 $ this ->assertSame ('bar ' , $ debug ->getNormalizer ($ option ));
190175 }
191176
192- /**
193- * @expectedException \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException
194- * @expectedExceptionMessage The option "foo" does not exist.
195- */
196177 public function testGetNormalizerThrowsOnNotDefinedOption ()
197178 {
179+ $ this ->expectException ('Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException ' );
180+ $ this ->expectExceptionMessage ('The option "foo" does not exist. ' );
198181 $ resolver = new OptionsResolver ();
199182
200183 $ debug = new OptionsResolverIntrospector ($ resolver );
0 commit comments