Laravel 8 响应断言
Laravel 为你的 PHPUnit 功能测试提供了各种自定义断言方法。这些断言可以在从 json
,get
,post
,put
和 delete
测试方法返回的响应中访问:
assertCookie
assertCookieExpired
assertCookieNotExpired
assertCookieMissing
assertCreated
assertDontSee
assertDontSeeText
assertExactJson
assertForbidden
assertHeader
assertHeaderMissing
assertJson
assertJsonCount
assertJsonFragment
assertJsonMissing
assertJsonMissingExact