Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Laravel 5.x Cookbook

You're reading from  Laravel 5.x Cookbook

Product type Book
Published in Sep 2016
Publisher Packt
ISBN-13 9781786462084
Pages 402 pages
Edition 1st Edition
Languages
Authors (2):
Terry Matula Terry Matula
Profile icon Terry Matula
Alfred Nutile Alfred Nutile
Profile icon Alfred Nutile
View More author details

Table of Contents (17) Chapters

Laravel 5.x Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Setting Up and Installing Laravel 2. Using Composer Packages 3. Routing 4. Building Views and Adding Style 5. Working with Data 6. Adding Angular to Your App 7. Authentication, Security, and Subscriptions 8. Testing and Debugging Your Application 9. Adding Advanced Features to Your App 10. Deploying Your App Index

Using VCR for API testing


Alright, we are now making calls with Guzzle to a real API (see the section Using Tests to Think Through Your Code TDT (Test Driven Thinking) earlier in this chapter). But they are going to get pretty annoyed with us if we are hitting their API for all our tests. Also, it is going to slow down our tests. Right now, the speed difference is nominal since there is only one request, but once there are more, the time will really add up. So, to prevent this, we begin to use VCR to create fixtures of our HTTP requests and responses so that the next time we call them, they are delivered to us instead.

Getting ready

This one is a bit tricky on the installation. I will cover the installation in the upcoming steps, and then go into detail in the How it Works… section. Also, this is one of the recipes that I will be doing from inside Homestead, so begin with homestead ssh into your box.

How to do it...

  1. Install SOAP for PHP:

    > sudo apt-get install php-soap
    
  2. Then, we can go on...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}