These are the steps, from scratch:
- Docker 4.0.1 in Windows 10 is running
- Ubuntu 20.04 is in WSL2 mode
- within
~runcurl -s https://laravel.build/example-app | bash -
cd example-app -
sail up -d -
sail test --parallelis successful (after Running tests in parallel requires "brianium/paratest". Do you wish to install it as a dev dependency? - yes):
Time: 00:00.418, Memory: 20.00 MB
OK (2 tests, 2 assertions)
But then:
- nano
tests\Features\ExampleTest.phpto importuse RefreshDatabase;
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class ExampleTest extends TestCase
{
use RefreshDatabase;
/**
* A basic test example.
*
* @return void
*/
public function test_example()
{
$response = $this->get('/');
$response->assertStatus(200);
}
}
There was 1 error:
- Tests\Feature\ExampleTest::test_example
Illuminate\Database\QueryException: SQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user 'sail'@'%' to database 'example_app_test_2' (SQL: drop database if exists
example_app_test_2)
What am I missing?