Skip to content

Commit

Permalink
Make this test more robust
Browse files Browse the repository at this point in the history
The order of properties in changed in various places (including serialization and var_dump()) in PHP 8.1
  • Loading branch information
sebastianbergmann committed Mar 17, 2021
1 parent 753281e commit 5071503
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions tests/unit/Framework/Exception/ExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@ class ExceptionTest extends TestCase
{
public function testExceptionSleep(): void
{
$exception = new Exception();
$actual = (new Exception)->__sleep();

$expectedArray = [
'serializableTrace',
'message',
'code',
'file',
'line',
];

$this->assertSame($expectedArray, $exception->__sleep());
$this->assertCount(5, $actual);
$this->assertContains('serializableTrace', $actual);
$this->assertContains('message', $actual);
$this->assertContains('code', $actual);
$this->assertContains('file', $actual);
$this->assertContains('line', $actual);
}
}

0 comments on commit 5071503

Please sign in to comment.