Hi,

we are using two classes here. The FakeSoapClient which extends the normal SoapClient and is a generic way to mock all soap requests.
The FakesSoapServiceTrait was built because we are using the same data for multiple tests and it provides some “quality of life methods” to quickly bind the fake to laravels service container + insert our usual test data via the setSoapTestData method. You can find the code in our GitHub project https://github.com/aboutyou/fakesoap

ABOUT YOU TECH blog

Want to know more ABOUT TECH?