phpunit/phpunit-mock-objects
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+.
The package is archived with its last release in 2013 and has been superseded by PHPUnit's built-in mock functionality since PHPUnit 6.0 (2018). Architecture fit is poor for modern projects as core features are now natively integrated into PHPUnit, making this standalone library redundant. Integration feasibility is near-zero for new projects due to version conflicts (e.g., requires PHPUnit ^7.0 but was last updated in 2013). Technical risks include unpatched security vulnerabilities, undefined behavior with modern PHP versions (7.4+), and potential namespace clashes. Key questions: Why use this deprecated library when PHPUnit’s native createMock() is available? Are there legacy systems requiring it? If so, what migration path exists?
Stack fit is incompatible with current PHP/PHPUnit ecosystems. Modern projects using PHPUnit 7+ will fail to install this package due to version constraints. Migration path requires removing the dependency entirely and refactoring all tests to use PHPUnit’s native mocking API (e.g., createMock(), getMockBuilder()). Compatibility is broken for PHPUnit versions ≥6.0, and no backward compatibility exists. Sequencing: Do not integrate; instead, audit existing codebases for usage and prioritize removal. Teams should update tests immediately to leverage PHPUnit’s built-in mocks without additional dependencies.
Maintenance burden is high due to no active development, no security patches, and outdated dependencies (e.g., doctrine/instantiator requires legacy versions). Support is nonexistent—no community or official channels address issues. Scaling is irrelevant as the package is obsolete, but accidental usage would cause test failures in CI/CD pipelines. Failure modes include silent test errors, broken mocks due to PHP version incompatibilities, and dependency conflicts. Ramp-up time is negligible for existing teams since PHPUnit’s native mocking is well-documented and requires no new learning, but legacy code reliance would create technical debt.
How can I help you explore Laravel packages today?