2121
2222final class PackerTest extends TestCase
2323{
24+ use PhpUnitCompat;
25+
2426 /**
2527 * @var Packer
2628 */
@@ -104,7 +106,7 @@ public function provideOptionsData() : array
104106 public function testConstructorThrowsExceptionOnInvalidOptions ($ options ) : void
105107 {
106108 $ this ->expectException (InvalidOptionException::class);
107- $ this ->expectExceptionMessageRegExp ('/Invalid option .+?, use .+?/ ' );
109+ $ this ->expectExceptionMessageMatches ('/Invalid option .+?, use .+?/ ' );
108110
109111 new Packer ($ options );
110112 }
@@ -127,7 +129,7 @@ public function testConstructorSetsTransformers() : void
127129
128130 $ transformer = $ this ->createMock (CanPack::class);
129131 $ transformer ->expects (self ::once ())->method ('pack ' )
130- ->with ($ this -> isInstanceOf (Packer::class), $ obj )
132+ ->with (self :: isInstanceOf (Packer::class), $ obj )
131133 ->willReturn ($ packed );
132134
133135 $ packer = new Packer (null , [$ transformer ]);
@@ -146,7 +148,7 @@ public function testPackCustomType() : void
146148 $ transformer1 = $ this ->createMock (CanPack::class);
147149 $ transformer1 ->expects (self ::atMost (2 ))->method ('pack ' )
148150 ->with (
149- $ this -> isInstanceOf (Packer::class),
151+ self :: isInstanceOf (Packer::class),
150152 self ::logicalOr (self ::identicalTo ($ obj1 ), self ::identicalTo ($ obj2 ))
151153 )
152154 ->willReturnCallback (static function ($ packer , $ value ) use ($ obj1 , $ packed1 ) {
@@ -156,7 +158,7 @@ public function testPackCustomType() : void
156158 $ transformer2 = $ this ->createMock (CanPack::class);
157159 $ transformer2 ->expects (self ::atMost (2 ))->method ('pack ' )
158160 ->with (
159- $ this -> isInstanceOf (Packer::class),
161+ self :: isInstanceOf (Packer::class),
160162 self ::logicalOr (self ::identicalTo ($ obj1 ), self ::identicalTo ($ obj2 ))
161163 )
162164 ->willReturnCallback (static function ($ packer , $ value ) use ($ obj2 , $ packed2 ) {
@@ -175,7 +177,7 @@ public function testPackThrowsExceptionOnUnsupportedCustomType() : void
175177
176178 $ transformer = $ this ->createMock (CanPack::class);
177179 $ transformer ->expects (self ::once ())->method ('pack ' )
178- ->with ($ this -> isInstanceOf (Packer::class), $ obj )
180+ ->with (self :: isInstanceOf (Packer::class), $ obj )
179181 ->willReturn (null );
180182
181183 $ packer = $ this ->packer ->extendWith ($ transformer );
0 commit comments