public function createApplication()
{
$app = require __DIR__.'/../bootstrap/app.php';
$app->loadEnvironmentFrom('.env.testing');
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
return $app;
}
public function setUp()
{
parent::setUp();
$this->prepareForTests();
}
private function prepareForTests()
{
Artisan::call('migrate');
Artisan::call('db:seed');
}
public function tearDown()
{
parent::tearDown();
}
Why are you using two .env files? I usually use two connections one for production and one for local. I declare both connections in my only .env file and change the default connection when I need a different one.
Also check your config/database.php file both connections need to specified in this file and in your .env file.
@davedriesmans@gmail.com No, it's not. Pay particular attention to DB_CONNECTION and DB_DATABASE. I use that in all my setups. I use MariaDB represented in the .env file and I use a SQLite in memory DB for testing. There is no other env file needed unless you want to another MariaDB, MySQL or MongoDB DB for testing...but its not necessary.