Original link: https://www.mokeyjay.com/archives/3301
TL;DR $this->withUnencryptedCookie(‘cookie_name’, $cookieValue) ->withCredentials() text In unit testing, we usually use the $this->postJson() series of methods to test the interface. Before that, just use $ this->actingAs() can solve the problem of login status, but the interface to be tested this time is quite special, and it needs to go to coo
The method of setting request Cookie in the post Laravel unit test first appeared on mokeyjay – 超能小紫.
This article is transferred from: https://www.mokeyjay.com/archives/3301
This site is only for collection, and the copyright belongs to the original author.