【发布时间】:2021-05-23 23:40:27
【问题描述】:
下面有一个数据对象,我尝试使用邮递员进行测试。我只是不知道如何在 laravel 的单元测试中实现这一点。我已经访问过这个link,但它对我的情况没有帮助。
{
"user_id": 1,
"name": "juan",
"address": [
"state": "Auckland",
"country": "New Zealand",
],
"school": [
{
"school_name": "Kristin School",
"year": 2016
},
{
"school_name": "ACG Parnell College",
"year": 2018
},
],
// and more...
}
我们如何在单元测试中传递上面这样的对象?有什么方法可以实现吗?
$response = $this->post('/logbooks/user', ['Authorization': 'Bearer' + $token]);
【问题讨论】:
标签: php laravel unit-testing laravel-unit-test