Registry / testing / phake-phake

phake-phake

JSON →
library4.7.0phppackagistunverified

The Phake mock testing library

composer require phake/phake
INSTALL
IMPORT
SIG · PHAKE-PHAKE
P
phake-phake
testingphpv4.7.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Phake
use Phake\Phake;

Create a mock and stub a method return value

use Phake\Phake; $mock = Phake::mock(SomeClass::class); Phake::when($mock)->someMethod()->thenReturn('mocked'); echo $mock->someMethod(); // 'mocked'
Debug
Known issues
gotchaNot compatible with PHP 8.4's property hooks
fix
Avoid using property hooks in mocked classes or use a different mocking library
affects: >=4.0.0
Upgrade
Version history
4.7.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
phake-phake — pip install phake-phake · libregistry