12
12
use MabeEnumTest \TestAsset \Enum64 ;
13
13
use MabeEnumTest \TestAsset \Enum65 ;
14
14
use MabeEnumTest \TestAsset \Enum66 ;
15
- use PHPUnit_Framework_TestCase as TestCase ;
15
+ use PHPUnit \ Framework \ TestCase ;
16
16
17
17
/**
18
18
* Unit tests for the class MabeEnum\EnumSet
@@ -157,14 +157,14 @@ public function testIterateAndDetach()
157
157
158
158
public function testConstructThrowsInvalidArgumentExceptionIfEnumClassDoesNotExtendBaseEnum ()
159
159
{
160
- $ this ->setExpectedException (InvalidArgumentException::class);
160
+ $ this ->expectException (InvalidArgumentException::class);
161
161
new EnumSet (self ::class);
162
162
}
163
163
164
164
public function testInitEnumThrowsInvalidArgumentExceptionOnInvalidEnum ()
165
165
{
166
166
$ enumSet = new EnumSet (EnumBasic::class);
167
- $ this ->setExpectedException (InvalidArgumentException::class);
167
+ $ this ->expectException (InvalidArgumentException::class);
168
168
$ this ->assertFalse ($ enumSet ->contains (EnumInheritance::INHERITANCE ()));
169
169
}
170
170
@@ -396,15 +396,15 @@ public function testSetBinaryBitsetLeBinOutOfRangeBitsOfExtendedBytes1()
396
396
{
397
397
$ enumSet = new EnumSet (Enum65::class);
398
398
399
- $ this ->setExpectedException (InvalidArgumentException::class, 'Out-Of-Range ' );
399
+ $ this ->expectException (InvalidArgumentException::class, 'Out-Of-Range ' );
400
400
$ enumSet ->setBinaryBitsetLe ("\xff\xff\xff\xff\xff\xff\xff\xff\x00\x02" );
401
401
}
402
402
403
403
public function testSetBinaryBitsetLeBinOutOfRangeBitsOfExtendedBytes2 ()
404
404
{
405
405
$ enumSet = new EnumSet (Enum65::class);
406
406
407
- $ this ->setExpectedException (InvalidArgumentException::class, 'Out-Of-Range ' );
407
+ $ this ->expectException (InvalidArgumentException::class, 'Out-Of-Range ' );
408
408
$ enumSet ->setBinaryBitsetLe ("\xff\xff\xff\xff\xff\xff\xff\xff\x02" );
409
409
}
410
410
@@ -416,13 +416,13 @@ public function testSetBinaryBitsetLeBinOutOfRangeBitsOfLastValidByte()
416
416
$ bitset = $ enumSet ->getBinaryBitsetLe ();
417
417
$ newBitset = substr ($ bitset , 0 , -1 ) . "\x02" ;
418
418
419
- $ this ->setExpectedException (InvalidArgumentException::class, 'Out-Of-Range ' );
419
+ $ this ->expectException (InvalidArgumentException::class, 'Out-Of-Range ' );
420
420
$ enumSet ->setBinaryBitsetLe ($ newBitset );
421
421
}
422
422
423
423
public function testSetBinaryBitsetLeBinArgumentExceptionIfNotString ()
424
424
{
425
- $ this ->setExpectedException (InvalidArgumentException::class);
425
+ $ this ->expectException (InvalidArgumentException::class);
426
426
427
427
$ enum = new EnumSet (Enum65::class);
428
428
$ enum ->setBinaryBitsetLe (0 );
@@ -450,15 +450,15 @@ public function testSetBinaryBitsetLeIntOutOfRangeBitsOfExtendedBytes1()
450
450
{
451
451
$ enumSet = new EnumSet (EnumBasic::class);
452
452
453
- $ this ->setExpectedException (InvalidArgumentException::class, 'Out-Of-Range ' );
453
+ $ this ->expectException (InvalidArgumentException::class, 'Out-Of-Range ' );
454
454
$ enumSet ->setBinaryBitsetLe ("\x0A\xFF\x01" );
455
455
}
456
456
457
457
public function testSetBinaryBitsetLeIntOutOfRangeBitsOfExtendedBytes2 ()
458
458
{
459
459
$ enumSet = new EnumSet (EnumBasic::class);
460
460
461
- $ this ->setExpectedException (InvalidArgumentException::class, 'Out-Of-Range ' );
461
+ $ this ->expectException (InvalidArgumentException::class, 'Out-Of-Range ' );
462
462
$ enumSet ->setBinaryBitsetLe ("\x01\x01\x01\x01\x01\x01\x01\x01\x01" );
463
463
}
464
464
@@ -470,7 +470,7 @@ public function testSetBinaryBitsetLeIntOutOfRangeBitsOfLastValidByte()
470
470
$ bitset = $ enumSet ->getBinaryBitsetLe ();
471
471
$ newBitset = substr ($ bitset , 0 , -1 ) . "\xFF" ;
472
472
473
- $ this ->setExpectedException (InvalidArgumentException::class, 'Out-Of-Range ' );
473
+ $ this ->expectException (InvalidArgumentException::class, 'Out-Of-Range ' );
474
474
$ enumSet ->setBinaryBitsetLe ($ newBitset );
475
475
}
476
476
@@ -488,7 +488,7 @@ public function testSetBinaryBitsetBe()
488
488
489
489
public function testSetBinaryBitsetBeArgumentExceptionIfNotString ()
490
490
{
491
- $ this ->setExpectedException (InvalidArgumentException::class);
491
+ $ this ->expectException (InvalidArgumentException::class);
492
492
493
493
$ enum = new EnumSet (Enum65::class);
494
494
$ enum ->setBinaryBitsetBe (0 );
@@ -805,7 +805,7 @@ public function testUnionThrowsInvalidArgumentException()
805
805
$ set1 = new EnumSet (EnumBasic::class);
806
806
$ set2 = new EnumSet (Enum32::class);
807
807
808
- $ this ->setExpectedException (InvalidArgumentException::class);
808
+ $ this ->expectException (InvalidArgumentException::class);
809
809
$ set1 ->union ($ set2 );
810
810
}
811
811
@@ -830,7 +830,7 @@ public function testIntersectThrowsInvalidArgumentException()
830
830
$ set1 = new EnumSet (EnumBasic::class);
831
831
$ set2 = new EnumSet (Enum32::class);
832
832
833
- $ this ->setExpectedException (InvalidArgumentException::class);
833
+ $ this ->expectException (InvalidArgumentException::class);
834
834
$ set1 ->intersect ($ set2 );
835
835
}
836
836
@@ -855,7 +855,7 @@ public function testDiffThrowsInvalidArgumentException()
855
855
$ set1 = new EnumSet (EnumBasic::class);
856
856
$ set2 = new EnumSet (Enum32::class);
857
857
858
- $ this ->setExpectedException (InvalidArgumentException::class);
858
+ $ this ->expectException (InvalidArgumentException::class);
859
859
$ set1 ->diff ($ set2 );
860
860
}
861
861
@@ -883,7 +883,7 @@ public function testSymDiffThrowsInvalidArgumentException()
883
883
$ set1 = new EnumSet (EnumBasic::class);
884
884
$ set2 = new EnumSet (Enum32::class);
885
885
886
- $ this ->setExpectedException (InvalidArgumentException::class);
886
+ $ this ->expectException (InvalidArgumentException::class);
887
887
$ set1 ->symDiff ($ set2 );
888
888
}
889
889
}
0 commit comments