Database testing with PHPUnit in laravel

PHPUnit is well integrated with Laravel 5 as it was with Laravel 4, so it is rather easy to set up the testing environment. A good method for testing would be to use the SQLite database and to set it up to reside in the memory, but you need to modify the config/database.php file, as follows:

    'default' => 'sqlite',
       'connections' => array(
        'sqlite' => array(
            'driver'   => 'sqlite',
            'database' => ':memory:',
            'prefix'   => '',
        ),
    ),




Recommended :  Learn Everything about middlewares in laravel 5.1

About the author

Deven Rathore

I'm Deven Rathore, a multidisciplinary & self-taught designer with 3 years of experience. I'm passionate about technology, music, coffee, traveling and everything visually stimulating. Constantly learning and experiencing new things.

  • i get this error
    ReflectionException: Class env does not exist
    the stack trace shows this triggers on the tearDown method where the artisan rollback command is called. i dont seem to understand this behavior and what to do

Pin It on Pinterest

Shares