1. Go to this page and download the library: Download yii1tech/async-cmd 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/ */
use yii1tech\async\cmd\Command;
use yii1tech\async\cmd\CommandDispatcher;
class StatsGenerateLauncherTest extends TestCase
{
public function testLaunchStatsGenerate(): void
{
$launcher = Yii::app()->getComponent(StatsGenerateLauncher::class);
$launcher->launch(); // dispatches async command inside
$dispatcher = Yii::app()->getComponent(CommandDispatcher::class);
$runner = $dispatcher->getCommandRunner();
$command = $runner->getLastCommand();
// check if the async command has been dispatched with the correct parameters:
$this->assertTrue($command instanceof Command);
$this->assertSame(StatsCommand::class, $command->getCommandClass());
$this->assertSame('generate', $command->getCommandAction());
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.