Registry /
testing / phpspec-prophecy-phpunit
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.
ProphecyTrait
✓ use Prophecy\PhpUnit\ProphecyTrait;
Using Prophecy mocking in a PHPUnit test case.
use Prophecy\PhpUnit\ProphecyTrait;
class MyTest extends \PHPUnit\Framework\TestCase
{
use ProphecyTrait;
public function testSomething(): void
{
$prophecy = $this->prophesize(SomeClass::class);
$prophecy->someMethod()->willReturn('value');
$this->assertEquals('value', $prophecy->reveal()->someMethod());
}
}
Debug
Known issues
No known issues recorded.
Audit
Dependencies
No dependency data recorded yet.