PHP code example of harmonyio / phpunit-extension
1. Go to this page and download the library: Download harmonyio/phpunit-extension 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/ */
harmonyio / phpunit-extension example snippets
declare(strict_types=1);
namespace Foo\Test\Unit;
use Amp\Success;
use HarmonyIO\PHPUnitExtension\TestCase;
class BarTest extends TestCase
{
public function testPromiseValueAssertsCorrectly(): void
{
// the promise will be automatically resolved here
// and the eventual value will be asserted instead of the promise itself
$this->assertTrue(new Success(true));
}
}