Unit Testing Guzzle inside of Laravel Controller with PHPUnit

前端 未结 3 522
栀梦
栀梦 2021-01-05 17:43

I\'m not quite sure which way to approach unit testing in this scenario. None of the examples for unit testing Guzzle quite make sense to me how to implement in this scenari

3条回答
  •  不知归路
    2021-01-05 18:22

    Use https://github.com/php-vcr/php-vcr package. It helps to record and replay HTTP requests. It is very handy for testing api calls via Guzzle

提交回复
热议问题