Laravel 5 app always using 'testing' environment configuration

前端 未结 3 1657
南方客
南方客 2021-02-04 08:43

I have a Laravel 5 app with two environments and two configurations: testing (for PHPUnit configuration, in-memory db) and local (my development configuration).

Even whe

3条回答
  •  孤独总比滥情好
    2021-02-04 09:33

    Additional points I've just had to use to get tests running on sqlite, while the main app normally defaults to mysql:

    Add something like this to phpunit.xml, as explained by craig.michael.morris:

    
    

    And this change to config/database.php

    'default' => env('DB_DRIVER', 'mysql'),
    

    And in the 'sqlite' section of config/database.php

    'database' => ':memory:',
    

提交回复
热议问题