Skip to content

Commit 78affaa

Browse files
Merge branch '10.5' into 11.5
2 parents 2452f3a + 4e7483a commit 78affaa

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

ChangeLog-11.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 11.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
44

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

713
### Fixed
@@ -326,6 +332,7 @@ All notable changes of the PHPUnit 11.5 release series are documented in this fi
326332
* [#6055](https://github.com/sebastianbergmann/phpunit/issues/6055): `assertNotContainsOnly()` (use `assertContainsNotOnlyArray()`, `assertContainsNotOnlyBool()`, `assertContainsNotOnlyCallable()`, `assertContainsNotOnlyFloat()`, `assertContainsNotOnlyInt()`, `assertContainsNotOnlyIterable()`, `assertContainsNotOnlyNumeric()`, `assertContainsNotOnlyObject()`, `assertContainsNotOnlyResource()`, `assertContainsNotOnlyClosedResource()`, `assertContainsNotOnlyScalar()`, or `assertContainsNotOnlyString()` instead)
327333
* [#6059](https://github.com/sebastianbergmann/phpunit/issues/6059): `containsOnly()` (use `containsOnlyArray()`, `containsOnlyBool()`, `containsOnlyCallable()`, `containsOnlyFloat()`, `containsOnlyInt()`, `containsOnlyIterable()`, `containsOnlyNumeric()`, `containsOnlyObject()`, `containsOnlyResource()`, `containsOnlyClosedResource()`, `containsOnlyScalar()`, or `containsOnlyString()` instead)
328334

335+
[11.5.37]: https://github.com/sebastianbergmann/phpunit/compare/11.5.36...11.5
329336
[11.5.36]: https://github.com/sebastianbergmann/phpunit/compare/11.5.35...11.5.36
330337
[11.5.35]: https://github.com/sebastianbergmann/phpunit/compare/11.5.34...11.5.35
331338
[11.5.34]: https://github.com/sebastianbergmann/phpunit/compare/11.5.33...11.5.34

src/Framework/Exception/Exception.php

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

73-
public function __sleep(): array
73+
public function __serialize(): array
7474
{
75-
return array_keys(get_object_vars($this));
75+
return get_object_vars($this);
7676
}
7777

7878
/**

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)