A PHP mocking framework inspired by Mockito, using a verification strategy for test doubles and method stubs.
PHP Mocking Framework
Phake verifies method calls after test execution, unlike expectation-based frameworks, offering a more natural workflow that aligns with how developers think about testing.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Inspired by Mockito for Java, it addresses flexibility gaps in PHP mocking tools, providing a familiar and powerful API for creating mocks and stubs.
The project includes a dedicated website and documentation, making it easier for developers to learn and implement mocking patterns effectively.
With a PHPStorm plugin available, Phake enhances developer experience through better tooling like code completion and refactoring assistance.
Developers accustomed to PHPUnit's expectation-based mocking may face a learning curve with Phake's verification-after-execution approach, potentially slowing adoption.
As a separate framework, integrating Phake into existing PHPUnit test suites can require additional configuration and compatibility checks, unlike native solutions.
Compared to PHPUnit's built-in mocking, Phake has a smaller user base, which might mean fewer community resources, tutorials, or third-party extensions.