PHP code example of mnvx / pprocess
1. Go to this page and download the library: Download mnvx/pprocess 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/ */
mnvx / pprocess example snippets
use PHPUnit\Framework\TestCase;
use Mnvx\PProcess\Command\Command;
use Mnvx\PProcess\AsyncTrait;
/**
* 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));
}
}