Registry / testing / phpspec-prophecy-phpunit

phpspec-prophecy-phpunit

JSON →
library2.5.0phppackagistunverified

Integrating the Prophecy mocking library in PHPUnit test cases

composer require phpspec/prophecy-phpunit
INSTALL
IMPORT
SIG · PHPSPEC-PROPHECY-P
P
phpspec-prophecy-phpunit
testingphpv2.5.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.

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.

Upgrade
Version history
2.5.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Resources
phpspec-prophecy-phpunit — pip install phpspec-prophecy-phpunit · libregistry