ArtisanTinkerer.github.io

Blog

View on GitHub

Testing!

Laravel comes with:

Basics

ExampleTest.php extends TestCase.php

To run:

’’’ ./vendor/bin/phpunit ‘’’

Environment name: local,staging or production. Can be used in control structures.

.env variables come from phpunit.xml

The Testing Traits

WithoutMiddleware

-disables middleware

DatabaseMigrations

DatabaseTransactions

Application Testing

Clicking and Forms

pg275

Mocking

Used to create a class that mimics a real class because real class is too difficult to instantiate.

What next?

Adam Wathan Laracon [https://streamacon.com/video/laracon-us/adam-wathan-test-driven-laravel]

Notes from this:

Walking Skeleton

“Programming by Wishfull Thinking”

28:33 findByUsername - unit testing

Laracasts testing stuff