-
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix serialization of ComparisionFailure with PDO in stacktrace.
This fix implements a custom serialize/deserialize method on the ComparisionFailure class, which means it loses the stack trace during serialization. This allows PHPUnit to run in process isolation mode when the stack trace may contain references to non-serializable objects such as the PDO.
- Loading branch information
Showing
3 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/* | ||
* This file is part of sebastian/comparator. | ||
* | ||
* (c) Sebastian Bergmann <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace SebastianBergmann\Comparator; | ||
|
||
class NonSerializableClass implements \Serializable { | ||
public function serialize() | ||
{ | ||
throw new \Error('This class cannot be serialized'); | ||
} | ||
|
||
public function unserialize($serialized) {} | ||
} |