Код: Выделить всё
class Testclass
{
public WebshopappApiClient $client;
public function __construct(Webshop $webshop)
{
$this->client = app()->make(WebshopappApiClient::class, ['webshop' => $webshop]);
}
public function callTestMethod()
{
// This should be Mock value std empty class
dd($this->client->shipments);
}
}
Код: Выделить всё
Подробнее здесь: [url]https://stackoverflow.com/questions/78821883/laravel-how-to-use-mockery-to-mock-service-bindings[/url]
Мобильная версия