Skip to content

Commit dae9735

Browse files
Merge branch '9.6' into 10.5
2 parents e28d9b1 + d352892 commit dae9735

File tree

7 files changed

+16
-17
lines changed

7 files changed

+16
-17
lines changed

ChangeLog-10.5.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ All notable changes of the PHPUnit 10.5 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 `ReflectionProperty::setAccessible()` with PHP >= 8.1
11+
* Do not use `SplObjectStorage` methods that will be deprecated in PHP 8.5
1012

1113
## [10.5.49] - 2025-08-09
1214

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/end-to-end/mock-objects/generator/return_type_declarations_generator_empty_by_default.phpt

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,10 @@ $generator = new \PHPUnit\Framework\MockObject\Generator\Generator;
1919

2020
$mock = $generator->testDouble('Foo', false);
2121

22-
var_dump(iterator_to_array($mock->forTraversable()));
23-
var_dump(iterator_to_array($mock->forGenerator()));
24-
var_dump(iterator_to_array($mock->forIterable()));
22+
print count(iterator_to_array($mock->forTraversable())) . PHP_EOL;
23+
print count(iterator_to_array($mock->forGenerator())) . PHP_EOL;
24+
print count(iterator_to_array($mock->forIterable())) . PHP_EOL;
2525
--EXPECTF--
26-
array(0) {
27-
}
28-
array(0) {
29-
}
30-
array(0) {
31-
}
26+
0
27+
0
28+
0

tests/unit/Framework/AssertTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2321,9 +2321,9 @@ protected static function notEqualValues(): array
23212321
$object2 = new SampleClass(16, 23, 42);
23222322
$object3 = new SampleClass(4, 8, 15);
23232323
$storage1 = new SplObjectStorage;
2324-
$storage1->attach($object1);
2324+
$storage1->offsetSet($object1);
23252325
$storage2 = new SplObjectStorage;
2326-
$storage2->attach($object3); // same content, different object
2326+
$storage2->offsetSet($object3); // same content, different object
23272327

23282328
$file = TEST_FILES_PATH . 'foo.xml';
23292329

@@ -2462,9 +2462,9 @@ protected static function equalValues(): array
24622462
$object1 = new SampleClass(4, 8, 15);
24632463
$object2 = new SampleClass(4, 8, 15);
24642464
$storage1 = new SplObjectStorage;
2465-
$storage1->attach($object1);
2465+
$storage1->offsetSet($object1);
24662466
$storage2 = new SplObjectStorage;
2467-
$storage2->attach($object1);
2467+
$storage2->offsetSet($object1);
24682468

24692469
return [
24702470
// arrays

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)