-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Omise Unit Tests Clashing With Laravel Unit Tests #110
Comments
@ahirota Hi, this might not related to the solution that you are looking for, but would you mind to share a case where you want to connect to the real API server for a unit test script? Is there any specific reason to bypass the fixture files? |
@guzzilar To Preface, I've created a Repository to handle calls to the Omise API. My test suites are all designed to test basic functionality within my application and I'd need to connect to the real API server in order for my tests to pass. One of my test suites generates a new customer with a customer token, tests creating charges, creating and destroying charge schedules, adding and removing cards from the customer, and then finally removing the customer all together. If I were to use the default fixture files, the act of creating a new customer with email: Here's a code example:
In this test, both assertions fail because new customer data is never created. The response is always taken from the fixture files. This issue extends to customer tokens and beyond. I guess my main issue is that I don't want to test the package itself, but rather the extensions and wrappers I've created, and using PHPunit calls |
Hey all,
To preface, Laravel has phpunit tests built into the framework, where users can write custom tests for various parts of their application. Ideally, I'd like to use my own custom tests with the Omise Test API, but due to the snippet below, any phpunit tests (including Laravel's) are executed with the executeTest() method and return data saved in the tests/fixtures directory.
My current workaround is deleting the contents of the fixtures folder before I run my tests, forcing executeTest to go and retrieve the data from the test API source. Is there any way to override this method? Or maybe a way to localize the
preg_match
to only the Omise Vendor files?The text was updated successfully, but these errors were encountered: