php-mock/php-mock-prophecy
Prophecy integration for php-mock lets you mock PHP built-in functions like time, rand, and sleep inside Prophecy test doubles. Define expected behavior for global functions alongside class mocks, making time-dependent code testable without hard dependencies.
|
Package
|
Score
|
Description
|
Stars
|
Likes
|
Forks
|
Downloads
|
Issues
|
Score
|
Opportunity
|
License
|
Last Release
|
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| donatj/mock-webserver | 0.89 | Lightweight PHP mock web server for tests and local development. Spin up an HTTP server on a random port, enqueue canned responses, inspect received requests, and simulate endpoints reliably. Handy for integration tests without external services. | 141 | 142 | 22 | 72K | 5 | 17.6 | 42.3 | MIT | 8 months ago | |
| phpunit/phpunit-mock-objects | 0.88 | Default mock object library for PHPUnit. Create test doubles (mocks, stubs, spies) to isolate units under test, define expectations, control method returns, and verify interactions. Designed for PHPUnit projects and compatible with PHP 7.1+. | 4,920 | 5,056 | 151 | 759K | 0 | 15.2 | 21.4 | NOASSERTION | 13 years ago | |
| phpspec/prophecy | 0.88 | 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+. | 8,462 | 8,498 | 245 | 3M | 89 | 67.7 | 61.3 | MIT | 8 months ago | |
| php-mock/php-mock-mockery | 0.87 | Integrates php-mock with Mockery to mock PHP built-in functions in tests. Create namespaced function mocks with PHPMockery::mock() and set expectations/returns, then call Mockery::close(). Supports only unqualified calls; define early if needed. | 39 | 39 | 5 | 78K | 2 | 1.9 | 45.4 | WTFPL | 1 year ago | |
| console-helpers/prophecy-phpunit | 0.87 | PHPUnit integration helpers for Prophecy, providing convenience traits and utilities to streamline mock creation, prophecy assertions, and cleanup in your test suite. Designed to reduce boilerplate and keep Prophecy-based unit tests tidy and consistent. | 0 | 0 | 1 | 51 | 0 | 12.1 | 26.1 | MIT | 5 months ago | |
| psr-mock/http-client-implementation | 0.87 | Tiny PSR-18 HTTP client implementation intended for mocking and testing. Provides a simple client you can plug into PSR-7/PSR-17 workflows to return predefined responses without real network calls. | 1 | 1 | 0 | 3K | 0 | 0.6 | 44.8 | MIT | 2 years ago | |
| phpspec/prophecy-phpunit | 0.87 | 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. | 195 | 195 | 39 | 1M | 1 | 11.7 | 56.7 | MIT | 8 months ago | |
| php-mock/php-mock-integration | 0.87 | Integration layer for php-mock, making it easy to use PHP function mocks within popular test frameworks. Helps you stub built-in functions like time(), rand(), and file operations in specific namespaces, enabling reliable, isolated unit tests without touching global state. | 14 | 14 | 6 | 374K | 0 | 8.2 | 57.8 | WTFPL | 9 months ago | |
| jangregor/phpstan-prophecy | 0.87 | 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 | 111 | 30 | 414K | 3 | 18.6 | 53.5 | MIT | 8 months ago | |
| weirdan/prophecy-shim | 0.87 | Lightweight shim around Prophecy for PHPUnit, helping keep legacy Prophecy-based tests running on newer PHPUnit/Laravel stacks. Provides compatibility glue with minimal changes so you can upgrade tooling without rewriting your mocks. | 1 | 1 | 0 | 3K | 0 | 1.5 | 43.6 | — | 6 years ago | |
| php-mock/php-mock | 0.87 | 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). | 370 | 375 | 19 | 726K | 3 | 13.0 | 47.8 | WTFPL | 9 months ago | |
| janmarek/mockista | 0.87 | Mockista is a lightweight mocking library for PHP/Laravel that helps you create and configure test doubles quickly. Define expectations, stub methods, and verify calls with a simple, fluent API to keep unit tests fast, readable, and maintainable. | 29 | 29 | 14 | 248 | 2 | 1.4 | 14.9 | — | — | |
| php-mock/php-mock-phpunit | 0.87 | Integrate php-mock with PHPUnit to mock built-in PHP functions (like time(), file_get_contents(), etc.) in a controlled, namespaced way. Ideal for unit tests that need to simulate IO, time, and other global behaviors without changing production code. | 173 | 176 | 20 | 236K | 4 | 28.3 | 51.3 | WTFPL | 1 month ago | |
| lendable/phpunit-extensions | 0.86 | — | 2 | 2 | 0 | 2K | 1 | 8.6 | 43.2 | MIT | 8 months ago | |
| mpyw/mockery-pdo | 0.86 | Experimental BDD-style PDO mocking library built on mockery/mockery. Define expectations for prepare/bind/execute and return rows via fetch/fetchAll in a fluent API, making PDO-based code easy to test on PHP 8.2+. | 3 | 3 | 2 | 1K | 1 | 5.1 | 34.5 | MIT | 10 months ago | |
| phpstan/phpstan-mockery | 0.86 | PHPStan extension for Mockery: infers intersection types for mocks (Foo&MockInterface), understands shouldReceive/shouldHaveReceived/allows/expects, supports partial/alias/overload mocks, multiple interfaces, and proper constructor args for accurate static analysis. | 110 | 107 | 25 | 1M | 8 | 9.4 | 57.8 | MIT | 1 year ago | |
| codeception/mockery-module | 0.86 | Codeception module that integrates the Mockery mocking framework into your test suite, making it easy to create, use, and verify mock objects in PHP unit and functional tests with minimal setup. | 34 | 34 | 12 | 65K | 2 | 0.9 | 45.0 | MIT | 4 years ago | |
| codeception/aspect-mock | 0.85 | — | 784 | 791 | 132 | 14K | 40 | 27.3 | 32.9 | MIT | 4 years ago | |
| mockery/mockery | 0.85 | Mockery is a flexible PHP mock object framework for unit testing with PHPUnit, PHPSpec, or any other testing framework. It offers a succinct, human-readable DSL for defining test doubles and integrates easily as a drop-in alternative to PHPUnit's mocking library. | 10,724 | 10,808 | 470 | 19M | 89 | 84.3 | 77.1 | BSD-3-Clause | 2 months ago | |
| mnapoli/phpunit-easymock | 0.85 | 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 | 1K | 0 | 4.8 | 20.6 | MIT | 1 year ago |
How can I help you explore Laravel packages today?