当使用Get Stream Laravel包装器在Laravel中编写测试时,我想测试删除反应。
我基本上是这样做的:
$client = FeedManager::getClient();
$reactions = $client->reactions()->filter('user_id' , $this->user->id);
$client->reactions()->delete($reactions['results'][0]['id']);
结果是这样
GuzzleHttp\Exception\ClientException: Client error: `DELETE https://api.stream-io-api.com/api/v1.0/reaction/e9a919f2-2e28-4c5d-889e-c5f60b5880e9/` resulted in a `404 Not Found` response:
{"detail":"Reaction does not exist","status_code":404,"code":16,"exception":"DoesNotExistException","duration":"1.69ms"}
我可以确认$ reactions不为空,并给我有效的答复。 在我的基本应用程序中,它可以按预期工作,但是由于某种原因我的测试失败。 怎么了?