eboreum / phpunit-extras
Extra PHPUnit helpers for assertions, mock factories, and reusable test-case utilities.
Requires
- php: ^8.5
- eboreum/caster: ^3.0
- eboreum/exceptional: ^3.0
- eboreum/immutable-interface: ^1.0
- eboreum/phpunit-with-consecutive-alternative: ^3.0
- phpunit/phpunit: ^13.1
- sebastian/diff: ^9.0
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^1.2
- overtrue/phplint: ^9.7
- phpstan/phpstan: ^2.1
- ramsey/uuid: ^4.9
- slevomat/coding-standard: ^8.27
- squizlabs/php_codesniffer: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-19 13:01:12 UTC
README

PHPUnit Extras is a PHP 8.5 library for test suites that want reusable PHPUnit helpers without copying boilerplate between projects.
It provides assertion helpers for throwable messages, object initialization, base64 strings, and debug identifiers; utilities for creating constructor-aware mocks and reflection-built test objects; value mockers for common type hints; and a trait/interface pair that exposes the helpers from your own PHPUnit test cases.
Requirements
"php": "^8.5",
"eboreum/caster": "^3.0",
"eboreum/exceptional": "^3.0",
"eboreum/immutable-interface": "^1.0",
"eboreum/phpunit-with-consecutive-alternative": "^3.0",
"phpunit/phpunit": "^13.1",
"sebastian/diff": "^9.0"
Installation
Via Composer (https://packagist.org/packages/eboreum/phpunit-extras):
composer require eboreum/phpunit-extras
Via GitLab:
git clone git@gitlab.com:eboreum/phpunit-extras.git
License
See LICENSE file. Basically: Use this library at your own risk.
Contributing
We prefer that you create an issue and or a merge request at https://gitlab.com/eboreum/phpunit-extras, and have a discussion about a feature or bug here.
Credits
Authors
- Kasper Søfren (kafoso)
E-mail: soefritz@gmail.com
Homepage: https://gitlab.com/kafoso / https://github.com/kafoso
AI Implementation Assistance Disclaimer
AI, GPT-5.5 specifically, was used in the implementation of this codebase. However, the code has been thoroughly reviewed by human eyes.