Skip to content

Commit 4e7483a

Browse files
Merge branch '9.6' into 10.5
2 parents bbf7d14 + 486c954 commit 4e7483a

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

ChangeLog-10.5.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes of the PHPUnit 10.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
44

5+
## [10.5.54] - 2025-MM-DD
6+
7+
### Changed
8+
9+
* Do not use `__sleep()` method (which will be deprecated in PHP 8.5)
10+
511
## [10.5.53] - 2025-08-20
612

713
### Changed
@@ -472,6 +478,7 @@ All notable changes of the PHPUnit 10.5 release series are documented in this fi
472478

473479
* [#5563](https://github.com/sebastianbergmann/phpunit/issues/5563): `createMockForIntersectionOfInterfaces()` does not automatically register mock object for expectation verification
474480

481+
[10.5.54]: https://github.com/sebastianbergmann/phpunit/compare/10.5.53...10.5
475482
[10.5.53]: https://github.com/sebastianbergmann/phpunit/compare/10.5.52...10.5.53
476483
[10.5.52]: https://github.com/sebastianbergmann/phpunit/compare/10.5.51...10.5.52
477484
[10.5.51]: https://github.com/sebastianbergmann/phpunit/compare/10.5.50...10.5.51

src/Framework/Exception/Exception.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ public function __construct(string $message = '', int|string $code = 0, ?Throwab
6767
}
6868
}
6969

70-
public function __sleep(): array
70+
public function __serialize(): array
7171
{
72-
return array_keys(get_object_vars($this));
72+
return get_object_vars($this);
7373
}
7474

7575
/**

tests/unit/Framework/Exception/ExceptionTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
#[Small]
1717
final class ExceptionTest extends TestCase
1818
{
19-
public function testExceptionSleep(): void
19+
public function testExceptionSerialize(): void
2020
{
21-
$actual = (new Exception)->__sleep();
21+
$actual = (new Exception)->__serialize();
2222

2323
$this->assertCount(5, $actual);
24-
$this->assertContains('serializableTrace', $actual);
25-
$this->assertContains('message', $actual);
26-
$this->assertContains('code', $actual);
27-
$this->assertContains('file', $actual);
28-
$this->assertContains('line', $actual);
24+
$this->assertArrayHasKey('serializableTrace', $actual);
25+
$this->assertArrayHasKey('message', $actual);
26+
$this->assertArrayHasKey('code', $actual);
27+
$this->assertArrayHasKey('file', $actual);
28+
$this->assertArrayHasKey('line', $actual);
2929
}
3030
}

0 commit comments

Comments
 (0)