我有这样一个类:
class CategoryClient
{
private $categories;
/**
* Constructor
* Retrieves JSON File
*/
public function __construct(Client $client)
{
$response = $client->request('GET', config('services.url'));
$this->categories = collect(json_decode($response->getBody(), true));
}
}
我怎么会嘲笑为PHPUnit的测试目的JSON响应? 并设置$this->categories
变量?