Skip to content

Commit 02638b7

Browse files
Merge branch '8.5' into 9.6
2 parents 2aa4957 + 34d3039 commit 02638b7

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

tests/unit/Framework/AssertTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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

tests/unit/Framework/Constraint/IsEqualTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

tests/unit/Framework/MockObject/MockObjectTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
*/
1010
namespace PHPUnit\Framework\MockObject;
1111

12+
use const PHP_VERSION;
1213
use function class_uses;
1314
use function func_get_args;
1415
use function get_class;
1516
use function get_parent_class;
1617
use function sprintf;
18+
use function version_compare;
1719
use Exception;
1820
use PHPUnit\Framework\ExpectationFailedException;
1921
use 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
}

0 commit comments

Comments
 (0)