Send apex CLI Command
You may emulate a CLI command sent to the apex
script by using the apex() method. For example:
public function testApexCli(): void
{
$res = $this->apex('my-package my-job', ['test', '1234']);
$this->assertStringContains($res, "Success");
}
Essentially, the above will call the CLI command located at /src/MyPackage/Opus/Cli/MyJob.php with the arguments "test" and "1234", then return its results. For details, please visit the apex() method documentation page page of the documentation.