assertSoftDeleted in Lumen How to test whether an object was soft deleted in Lumen? Laravel has an assertSoftDeleted() method, but it's not available in Lumen like many other assertions.
Diving in the source code the check is basically done with a simple count query
return $this->database->table($table)
->where($this->data)->whereNotNull('deleted_at')->count() > 0;
You can make your own helper method if you wish for a check like this.
$this->notSeeInDatabase('posts', [
'id' => $post->id,
'deleted_at' => null,
]);
This should work but still is not accurate.
P.S. Strange that Lumen has only a few basic assertions :(
Please sign in or create an account to participate in this conversation.