phpspec/prophecy
Highly opinionated yet flexible PHP mocking framework for unit tests. Create test doubles with a Prophet, define expected calls and return values, then reveal mocks and verify predictions. Works with PHPUnit and other frameworks; requires PHP 7.2+.
|
Package
|
Score
|
Description
|
Stars
|
Likes
|
Forks
|
Downloads
|
Issues
|
Score
|
Opportunity
|
License
|
Last Release
|
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| mockery/mockery | 0.86 | Mockery is a flexible PHP mock object framework for unit testing with PHPUnit, PHPSpec, and more. It provides a readable DSL to define expectations and interactions, integrates cleanly with PHPUnit, and can be used alongside PHPUnit’s own mocking tools. | 10,725 | 10,812 | 463 | 9M | 104 | 87.9 | 82.1 | BSD-3-Clause | 1 year ago | |
| phpspec/prophecy-phpunit | 0.84 | Integrates the Prophecy mocking library with PHPUnit for simpler, cleaner test doubles. Install via Composer and use the ProphecyTrait to call prophesize() inside your TestCase, set method predictions/returns, and reveal mocks for injection. | 192 | 193 | 42 | 1M | 1 | 25.5 | 63.4 | MIT | 1 month ago | |
| mnapoli/phpunit-easymock | 0.80 | A lightweight bridge between PHPUnit and EasyMock for PHP. Quickly create, replay, and verify mocks from your test cases with minimal boilerplate, helping you write clear unit tests using the familiar EasyMock-style workflow. | 38 | 38 | 4 | 708 | 0 | 24.8 | 20.8 | MIT | 1 year ago | |
| php-mock/php-mock | 0.80 | Mock built-in PHP functions like time() or rand() in tests by leveraging PHP’s namespace fallback: define namespaced replacements for unqualified calls. Works in non-global namespaces; supports common test frameworks via integrations (e.g., PHPUnit). | 369 | 374 | 20 | 545K | 3 | 28.0 | 51.9 | WTFPL | 2 months ago | |
| jangregor/phpstan-prophecy | 0.78 | PHPStan extension for phpspec/prophecy that improves type inference in tests. It teaches PHPStan the real types returned from Prophecy workflows like prophesize(), willExtend(), and reveal(), so your revealed doubles are understood as the mocked class. | 111 | 112 | 30 | 510K | 3 | 29.5 | 60.4 | MIT | 1 month ago |
How can I help you explore Laravel packages today?