mirror of
https://github.com/jez500/pricebuddy.git
synced 2026-11-24 19:58:13 +01:00
21 lines
472 B
PHP
Executable File
21 lines
472 B
PHP
Executable File
<?php
|
|
|
|
namespace Tests\Traits;
|
|
|
|
use Illuminate\Support\Facades\Http;
|
|
use Illuminate\Support\Facades\View;
|
|
|
|
trait ScraperTrait
|
|
{
|
|
protected function mockScrape(mixed $price, mixed $title = null, mixed $image = null): void
|
|
{
|
|
Http::fake([
|
|
'*' => Http::response(View::make('tests.product-page', [
|
|
'price' => $price,
|
|
'title' => $title,
|
|
'image' => $image,
|
|
])->render()),
|
|
]);
|
|
}
|
|
}
|