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

Generating tests


We need to make a test to start testing. And once again, Laravel makes this super easy.

Getting ready

SSH into Homestead using the command homestead ssh and cd into the recipe directory.

Note

I actually wrote this Artisan command for Laravel in September 2015. Inspired by all the easy workflows I get out of Artisan, I was surprised this one was not there. And I am not bringing this up just to show off, but just to show how you can add your ideas to this framework. Of course, some ideas get rejected, and this is fine, so go make a library to then use in Laravel, but keep trying! The commit is at https://github.com/laravel/framework/pull/10170.

How to do it...

  1. Type the following:

    >php artisan make:test ResultsRepositoryTest
    
  2. That's it!

How it works...

This is not much of a recipe! But let's dig into some of its aspects.

Why did I call it ResultsRepositoryTest? It might get tempting to just stick all your tests in one file but as your app grows, the file will become too hard to read...

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}