File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -2209,9 +2209,9 @@ protected function notEqualValues(): array
22092209 $ object2 = new SampleClass (16 , 23 , 42 );
22102210 $ object3 = new SampleClass (4 , 8 , 15 );
22112211 $ storage1 = new SplObjectStorage ;
2212- $ storage1 ->attach ($ object1 );
2212+ $ storage1 ->offsetSet ($ object1 );
22132213 $ storage2 = new SplObjectStorage ;
2214- $ storage2 ->attach ($ object3 ); // same content, different object
2214+ $ storage2 ->offsetSet ($ object3 ); // same content, different object
22152215
22162216 $ file = TEST_FILES_PATH . 'foo.xml ' ;
22172217
@@ -2350,9 +2350,9 @@ protected function equalValues(): array
23502350 $ object1 = new SampleClass (4 , 8 , 15 );
23512351 $ object2 = new SampleClass (4 , 8 , 15 );
23522352 $ storage1 = new SplObjectStorage ;
2353- $ storage1 ->attach ($ object1 );
2353+ $ storage1 ->offsetSet ($ object1 );
23542354 $ storage2 = new SplObjectStorage ;
2355- $ storage2 ->attach ($ object1 );
2355+ $ storage2 ->offsetSet ($ object1 );
23562356
23572357 return [
23582358 // arrays
Original file line number Diff line number Diff line change @@ -105,10 +105,10 @@ public function isEqualProvider(): array
105105 $ d ->c = $ c ;
106106
107107 $ storage1 = new SplObjectStorage ;
108- $ storage1 ->attach ($ a );
109- $ storage1 ->attach ($ b );
108+ $ storage1 ->offsetSet ($ a );
109+ $ storage1 ->offsetSet ($ b );
110110 $ storage2 = new SplObjectStorage ;
111- $ storage2 ->attach ($ b );
111+ $ storage2 ->offsetSet ($ b );
112112 $ storage1hash = spl_object_hash ($ storage1 );
113113 $ storage2hash = spl_object_hash ($ storage2 );
114114
Original file line number Diff line number Diff line change 99 */
1010namespace PHPUnit \Framework \MockObject ;
1111
12+ use const PHP_VERSION ;
1213use function class_uses ;
1314use function func_get_args ;
1415use function get_class ;
1516use function get_parent_class ;
1617use function sprintf ;
18+ use function version_compare ;
1719use Exception ;
1820use PHPUnit \Framework \ExpectationFailedException ;
1921use PHPUnit \Framework \TestCase ;
@@ -1352,7 +1354,11 @@ private function resetMockObjects(): void
13521354 $ refl = new ReflectionObject ($ this );
13531355 $ refl = $ refl ->getParentClass ();
13541356 $ prop = $ refl ->getProperty ('mockObjects ' );
1355- $ prop ->setAccessible (true );
1357+
1358+ if (version_compare (PHP_VERSION , '8.1.0 ' , '< ' )) {
1359+ $ prop ->setAccessible (true );
1360+ }
1361+
13561362 $ prop ->setValue ($ this , []);
13571363 }
13581364}
You can’t perform that action at this time.
0 commit comments