1. Go to this page and download the library: Download wizcodepl/laravel-pipe 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/ */
#[Group('e2e')]
class AcmeSupplierSyncTest extends TestCase
{
use RefreshDatabase;
public function test_sync_creates_products_from_real_api(): void
{
$run = app(AcmeDriver::class)->run(limit: 10);
// Strict: 0 failures means every sample record made it through
foreach ($run->getStages() as $stage => $stats) {
$this->assertSame(0, $stats['failed'],
"Stage {$stage} had {$stats['failed']} failures (entered={$stats['entered']})",
);
}
$this->assertGreaterThan(0, Product::count());
// Idempotency
$first = Product::count();
app(AcmeDriver::class)->run(limit: 10);
$this->assertSame($first, Product::count());
}
}
app/Pipes/Acme/
├── AcmeDriver.php ← loadItems() with TODO
├── AcmePipelineResolver.php ← resolve() with TODO
└── ApparelPipeline/
└── ApparelPipeline.php ← stages() with TODO