You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Feature/Unit test can not work, due to do not have "--domain" option, so .env is missing to load correct database
I got "Database file at path [ABSOLUTE_PATH/database/database.sqlite] does not exist. Ensure this is an absolute path to the database." error (ABSOLUTE_PATH is a example)
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\Models\User;
use Database\Seeders\UserSeeder;
class CustomTest extends TestCase
{
use RefreshDatabase;
/**
* test_get_db
*/
public function test_get_db(): void
{
$oResponse = $this->get('/');
$oResponse->assertStatus(302);
}
}
Run
php artisan test --testsuite=Feature --stop-on-failure --filter CustomTest
Thank you in advance for any help,
Best regards
The text was updated successfully, but these errors were encountered:
Hi,
New problem/question
Environnement
Env
.env
.env.test.lan
Database
database/database.sqlite
database/database_test.sqlite
Feature/Unit Test
tests\Feature\CustomTest.php
Run
php artisan test --testsuite=Feature --stop-on-failure --filter CustomTest
Thank you in advance for any help,
Best regards
The text was updated successfully, but these errors were encountered: