PHP code example of weirdan / prophecy-shim
1. Go to this page and download the library: Download weirdan/prophecy-shim library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
weirdan / prophecy-shim example snippets
namespace Your\Tests;
use PHPUnit\Framework\TestCase;
// The following trait is provided either by the shim or by phpspec/prophecy-phpunit
use Prophecy\PhpUnit\ProphecyTrait;
class YourTest extends TestCase
{
use ProphecyTrait;
public function testSomething(): void
{
// this won't throw warnings anymore in PHPUnit 9.1+
$objectProphecy = $this->prophesize(SomeClass::class);
}
}