Closed cvele closed 11 years ago
Have a look at how the unit tests for some of the other gateways are structured. Stripe is a good example:
https://github.com/adrianmacneil/omnipay/tree/master/tests/Omnipay/Stripe
Mocking responses is the only way, basically run some code locally and capture the successful and unsuccessful responses, then save them to text files and use them to write your tests.
I'm working on adding CyberSource as payment provider (https://github.com/cvele/omnipay/tree/CyberSource) and would appriciate a bit of help on building unit tests for few methods: Refund, DeleteCard, UpdateCard.
Main problem I have there is that those methods require id to be passed to them and I don't have it.
Would like to avoid mocking responses.
Also, how do you handle api key situations for tests ?