pprocess
1.0.0
Execution of processes in async mode for tests.
This extension for PhpUnit will help you to test bugs in processes which are executing in async mode. PProcess will help you to test deadlocks, conflicts with duplicate keys and other bugs in async processes.
<?php
use PHPUnitFrameworkTestCase;
use MnvxPProcessCommandCommand;
use MnvxPProcessAsyncTrait;
/**
* Class AsyncTest
*
* @use ./vendor/bin/phpunit tests/AsyncTest.php
*/
class AsyncTest extends TestCase
{
use AsyncTrait;
public function testCommandMustBeExecutedInAsyncMode()
{
// For Laravel
$testCommand = "php artisan my-command-one --env=testing";
$this->assertAsyncCommand(new Command($testCommand, dirname(dirname(__FILE__)), 5));
}
public function testCommandMustNotBeExecutedInAsyncMode()
{
// For Symfony
$testCommand = "bin/console my-command-two --env=testing";
$this->assertNotAsyncCommand(new Command($testCommand, dirname(dirname(__FILE__)), 5));
}
}
Using composer:
composer require mnvx/pprocess --dev
Released under the MIT license