PHPackages                             mpyw/phpunit-patch-serializable-comparison - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. mpyw/phpunit-patch-serializable-comparison

ActiveLibrary[Testing &amp; Quality](/categories/testing)

mpyw/phpunit-patch-serializable-comparison
==========================================

Fixes assertSame/assertEquals serialization errors running in separate processes.

v0.0.4(1y ago)15245.5k—4.4%2MITPHPPHP &gt;=5.3.3CI passing

Since Jun 23Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/mpyw/phpunit-patch-serializable-comparison)[ Packagist](https://packagist.org/packages/mpyw/phpunit-patch-serializable-comparison)[ RSS](/packages/mpyw-phpunit-patch-serializable-comparison/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

PHPUnit Patch Serializable Comparison [![Status](https://github.com/mpyw/phpunit-patch-serializable-comparison/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/mpyw/phpunit-patch-serializable-comparison/actions)
==========================================================================================================================================================================================================================================

[](#phpunit-patch-serializable-comparison-)

Fixes `assertSame()`/`assertEquals()` serialization errors running in separate processes.

Requirements
------------

[](#requirements)

- php: `>=5.3.3`
- [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit): `>=4.8.0`
- [sebastianbergmann/comparator](https://github.com/sebastianbergmann/comparator): `^1.0 || ^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0`

Installing
----------

[](#installing)

```
composer require --dev mpyw/phpunit-patch-serializable-comparison
```

Example
-------

[](#example)

```
class AssertionTest extends TestCase
{
    protected function callAssertSameReceivingClosure(\Closure $closure)
    {
        static::assertSame('aaa', 'bbb');
    }

    #[RunInSeparateProcess]
    #[PreserveGlobalState(enabled: false)]
    public function testAssertionIncludingUnserializableTrace()
    {
        static::callAssertSameInClosure(function () {});
    }
}
```

### Before Patching

[](#before-patching)

```
PHPUnit\Framework\Exception: PHP Fatal error:  Uncaught Exception: Serialization of 'Closure' is not allowed in Standard input code:XX
Stack trace:
#0 Standard input code(XX): serialize(Array)
#1 Standard input code(XX): __phpunit_run_isolated_test()
#2 {main}
  thrown in Standard input code on line XX

```

### After Patching

[](#after-patching)

```
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'aaa'
+'bbb'
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance60

Regular maintenance activity

Popularity42

Moderate usage in the ecosystem

Community9

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~449 days

Total

4

Last Release

441d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1351893?v=4)[mpyw](/maintainers/mpyw)[@mpyw](https://github.com/mpyw)

---

Top Contributors

[![mpyw](https://avatars.githubusercontent.com/u/1351893?v=4)](https://github.com/mpyw "mpyw (22 commits)")

---

Tags

isolatedpatchphpphpunittestingphpunitprocessisolationserializationpatchprocessesseparatebugfix

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mpyw-phpunit-patch-serializable-comparison/health.svg)

```
[![Health](https://phpackages.com/badges/mpyw-phpunit-patch-serializable-comparison/health.svg)](https://phpackages.com/packages/mpyw-phpunit-patch-serializable-comparison)
```

###  Alternatives

[phpunit/phpunit

The PHP Unit Testing framework.

20.0k910.7M134.8k](/packages/phpunit-phpunit)[phpunit/php-invoker

Invoke callables with a timeout

1.3k540.0M285](/packages/phpunit-php-invoker)[dama/doctrine-test-bundle

Symfony bundle to isolate doctrine database tests and improve test performance

1.2k37.2M144](/packages/dama-doctrine-test-bundle)[spatie/phpunit-snapshot-assertions

Snapshot testing with PHPUnit

69617.9M510](/packages/spatie-phpunit-snapshot-assertions)[dg/bypass-finals

Removes final keyword from source code on-the-fly and allows mocking of final methods and classes

57026.3M456](/packages/dg-bypass-finals)[shipmonk/coverage-guard

Enforce code coverage in your CI. Not by percentage, but target core methods. No more untested Facades, Controllers, or Repositories. Allows you to start enforcing coverage for new code only!

5318.5k4](/packages/shipmonk-coverage-guard)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
