Skip to content

Commit 43d1f5f

Browse files
Merge branch '11.5' into 12.3
2 parents 079b3bf + e747ae2 commit 43d1f5f

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

ChangeLog-12.3.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ All notable changes of the PHPUnit 12.3 release series are documented in this fi
77
### Changed
88

99
* [#6300](https://github.com/sebastianbergmann/phpunit/issues/6300): Emit warning when the name of a data provider method begins with `test`
10+
* Do not use `SplObjectStorage` methods that will be deprecated in PHP 8.5
1011

1112
## [12.3.1] - 2025-08-09
1213

src/Framework/Constraint/Traversable/TraversableContainsEqual.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class TraversableContainsEqual extends TraversableContains
2323
protected function matches(mixed $other): bool
2424
{
2525
if ($other instanceof SplObjectStorage) {
26-
return $other->contains($this->value());
26+
return $other->offsetExists($this->value());
2727
}
2828

2929
foreach ($other as $element) {

src/Framework/Constraint/Traversable/TraversableContainsIdentical.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class TraversableContainsIdentical extends TraversableContains
2323
protected function matches(mixed $other): bool
2424
{
2525
if ($other instanceof SplObjectStorage) {
26-
return $other->contains($this->value());
26+
return $other->offsetExists($this->value());
2727
}
2828

2929
foreach ($other as $element) {

tests/unit/Framework/Assert/assertEqualsTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ public static function equalValues(): array
6565
$object1 = new SampleClass(4, 8, 15);
6666
$object2 = new SampleClass(4, 8, 15);
6767
$storage1 = new SplObjectStorage;
68-
$storage1->attach($object1);
68+
$storage1->offsetSet($object1);
6969
$storage2 = new SplObjectStorage;
70-
$storage2->attach($object1);
70+
$storage2->offsetSet($object1);
7171

7272
return [
7373
// arrays
@@ -159,9 +159,9 @@ public static function notEqualValues(): array
159159
$object2 = new SampleClass(16, 23, 42);
160160
$object3 = new SampleClass(4, 8, 15);
161161
$storage1 = new SplObjectStorage;
162-
$storage1->attach($object1);
162+
$storage1->offsetSet($object1);
163163
$storage2 = new SplObjectStorage;
164-
$storage2->attach($object3); // same content, different object
164+
$storage2->offsetSet($object3); // same content, different object
165165

166166
$file = TEST_FILES_PATH . 'foo.xml';
167167

tests/unit/Framework/Constraint/Traversable/TraversableContainsEqualTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static function provider(): array
2828
$o = new stdClass;
2929

3030
$s = new SplObjectStorage;
31-
$s->attach($o);
31+
$s->offsetSet($o);
3232

3333
return [
3434
[

tests/unit/Framework/Constraint/Traversable/TraversableContainsIdenticalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static function provider(): array
2828
$o = new stdClass;
2929

3030
$s = new SplObjectStorage;
31-
$s->attach($o);
31+
$s->offsetSet($o);
3232

3333
return [
3434
[

0 commit comments

Comments
 (0)