Blog & Stuff

Using VCR for PHP API Testing

Posted: 2014-07-16 15:38:30

Testing that your code works against an API can take up lots of un-needed time. With this php-vcr library you can do ONE real request that saves a fixture file that will automatically be used with each additional requests!

They have decent docs on setting up but I will walk through them here.

That library should be a big help to try it out. You just need a Saucelabs account and make a file in the root of your folder called .env as noted in the README with your username and token for saucelabs and then run bin/phpunit.