I'm currently writing some code to interact with an API that doesn't have any official libraries. The provider has given me two sets of credentials - one for testing and one for production.
I'm wondering what the best practice is for choosing which set of credentials to use.
Should I assume Testing (or Production) by default and have a function like
setEnvironment($env) to change it as needed?
Would it be better to have two different classes to choose from when first setting up the connection like
new Api\Testing(); and
Or should the API use credentials provided by the rest of the application like
new Api($username, $password);