2626 */
2727class EnumTest extends TestCase
2828{
29- public function setUp ()
30- {
31- $ this ->resetStaticEnumProps ();
32- }
33-
34- public function tearDown ()
35- {
36- assert_options (ASSERT_ACTIVE , 1 );
37- }
38-
3929 /**
4030 * Un-initialize all known enumerations
4131 */
@@ -325,10 +315,15 @@ public function testEnabledAssertAmbiguousEnumeratorValues()
325315
326316 public function testDisabledAssertAmbiguousEnumeratorValues ()
327317 {
328- assert_options (ASSERT_ACTIVE , 0 );
329318 $ this ->expectException (InvalidArgumentException::class);
330319
331- EnumAmbiguous::get ('unknown ' );
320+ try {
321+ assert_options (ASSERT_ACTIVE , 0 );
322+ EnumAmbiguous::get ('unknown ' );
323+ } catch (\Exception $ e ) {
324+ assert_options (ASSERT_ACTIVE , 1 );
325+ throw $ e ;
326+ }
332327 }
333328
334329 public function testExtendedEnabledAssertAmbiguousEnumeratorValues ()
@@ -345,10 +340,15 @@ public function testExtendedEnabledAssertAmbiguousEnumeratorValues()
345340
346341 public function testExtendedDisabledAssertAmbiguousEnumeratorValues ()
347342 {
348- assert_options (ASSERT_ACTIVE , 0 );
349343 $ this ->expectException (InvalidArgumentException::class);
350344
351- EnumExtendedAmbiguous::get ('unknown ' );
345+ try {
346+ assert_options (ASSERT_ACTIVE , 0 );
347+ EnumExtendedAmbiguous::get ('unknown ' );
348+ } catch (\Exception $ e ) {
349+ assert_options (ASSERT_ACTIVE , 1 );
350+ throw $ e ;
351+ }
352352 }
353353
354354 public function testSingleton ()
0 commit comments