1. Go to this page and download the library: Download stripyhorse/stripyhorse-php 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/ */
$sim = new StripyHorse\Api\SimulatorApi(null, $config);
$printer = $sim->createPrinter(new StripyHorse\Model\CreatePrinterInputBody([
'name' => 'ci-run-42', 'preset' => '4x6',
]));
// Point the system under test at the printer, exactly like hardware:
$addr = $printer->getTcp()->getHost() . ':' . $printer->getTcp()->getPort();
// ... run your fulfillment code against $addr ...
// Then assert on what it printed:
$jobs = $sim->listJobs($printer->getId());
assert(count($jobs->getJobs()) === 1);
// Reproduce a paper-out jam and watch jobs hold in the buffer:
$sim->setPrinterFaults($printer->getId(), new StripyHorse\Model\Faults(['paper_out' => true]));
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.