Comments (2)
@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?
from omise-php.
@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: [email protected]
and any other parameters, returns with the response saved in the fixture files.
Here's a code example:
public function testCustomer()
{
// create
$customer = $this->OmiseRepository->makeCustomer('[email protected]', 333);
self::assertEquals('[email protected]', $customer->email);
// delete
$bool = $this->OmiseRepository->destroyCustomerById($customer->id);
self::assertTrue($bool);
}
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 _executeTest
for any Omise API related functions.
from omise-php.
Related Issues (20)
- Certificates file is several years old HOT 2
- Not receiving webhook for charges HOT 3
- Magento Checkout cart error HOT 1
- [Question] How to pass custom CURLOPT option HOT 2
- Live server issue HOT 7
- method OmiseCardList@retrieve use empty key HOT 1
- The bug related to storing keys in a singleton pattern. HOT 1
- Wrong OMISE_PHP_LIB_VERSION version in release tag v2.12.0 HOT 1
- Add a programmatic way to check whether the 3D Secure validation is enabled for a given Omise account HOT 3
- Provide the public access to the OmiseObject::$_values array at the whole with a method like getValues() HOT 4
- This library needs more love HOT 11
- Proposal for 3-0-0 design HOT 3
- How to get authorize_uri form $_values after call api charge HOT 3
- Some PHP hosting with curl can't use omise-lib HOT 3
- OmiseCardList::Count() works incorrect HOT 7
- api version HOT 2
- How to store Customer IDs? HOT 6
- Proposal: implement extension for Omnipay HOT 3
- omise-php should set CURLOPT_SSLVERSION to prevent TLS 1.1 request on some platform. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from omise-php.