i have a situation where i have to test the functionality of my site's user subscriptions on stripe. i have to do integration testing for the cancel plans functionality on my site using php unit and php-facebook-webdrivers, according to my knowledge it is not a good practice to create users on stripe from within my test cases, i heard the term mocking, what it does that it stubs the function and returns whatever you want to return for any method inside a class which is mocked, so i decided that when i will mock the
- Stripe_Subscription::cancel()
method to return my desired response rather than sending the call to stripe, i found the Phake php framework Phake which is used for this purpose.
But i cant get it to work with stripe calls, may be there is a possibility that i havent understood the concept correctly, they have provided example there but it works only with the interface class not the normal classes, can anyone tell me how to mock a simple class or if it is possible, because i cant find any community forum for Phake and it is really hard as it is the first time i am working on any such thing , i can provide my code also if required.
regards,
omer aslam