【发布时间】:2020-06-20 20:28:18
【问题描述】:
$post= factory(Model)->make();
$this->post(route("post.store", $post->toArray()))->assertSee($model->name);
$this->assertDatabaseHas($this->table, $model->toArray());
此代码有效。但是如果我们模拟请求:
$this->mock(PostRequest::class, function ($mock) {
$mock->shouldReceive('passes')->andReturn(true);
});
在这种情况下,返回空数据库错误
桌子是空的..
块引用
这怎么可能?
【问题讨论】: