1. Go to this page and download the library: Download uru/testhub-bundle 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/ */
namespace App\Sandbox;
use TestHub\Bundle\HttpClient\State\ContextProviderInterface;
final class CurrentAgentProvider implements ContextProviderInterface
{
public function __construct(private AgentRepository $agents) {}
public function get(): array
{
return [$this->agents->current()];
}
}
namespace App\Sandbox;
use TestHub\Bundle\Action\ActionInterface;
final class CheckStatusAction implements ActionInterface
{
public function getName(): string { return 'check_status'; }
public function getLabel(): string { return 'Check status'; }
public function getDescription(): string { return 'Asks the provider for the status of an order.'; }
/** Form fields, as name => label. */
public function getParameters(): array
{
return ['order_id' => 'Order ID'];
}
public function run(array $parameters): string
{
// ...
return 'Status checked.';
}
}
namespace App\Development\TestHub;
use TestHub\Bundle\Action\PayoutRunnerInterface;
final class PayoutRunner implements PayoutRunnerInterface
{
public function payout(string $provider, string $gateway, int $refId): void
{
// Start the payout for the gateway, as the payout cron does.
// Throw an exception to show the run as failed.
}
}