Mock Guzzle Requests in Functional Tests
Published: , Updated:
Tested with TYPO3: 11 LTS, 10 LTS
Topics: testing, typo3
Functional tests won't mock single implementations. But code often interacts with external systems by sending requests, e.g. via Guzzle. Guzzle is the default library used within TYPO3, so you might need to mock the requests within functional tests.
This blog post explains our solution which is based on Guzzle Docs and Susis Blog post on how to mock Guzzle Client implementation within Unit Tests.