assertOk(); expect($response->json('config.database_connection'))->toBe($connection); })->with([ 'mysql', 'mariadb', 'pgsql', 'sqlite', ]); test('sqlite is told where its database file lives', function () { $response = getJson('/api/v1/installation/database/config?connection=sqlite'); $response->assertOk(); expect($response->json('config.database_name'))->not->toBeEmpty(); }); test('server-based drivers are given a host and port to prefill', function (string $connection) { $response = getJson("/api/v1/installation/database/config?connection={$connection}"); expect($response->json('config.database_host'))->not->toBeEmpty() ->and($response->json('config.database_port'))->not->toBeEmpty(); })->with([ 'mysql', 'mariadb', 'pgsql', ]); /** * A driver we do not recognise must still produce something the wizard can * render, rather than the empty config that caused #79. */ test('an unrecognised driver still returns a renderable config', function () { $response = getJson('/api/v1/installation/database/config?connection=cockroach'); $response->assertOk(); expect($response->json('config.database_connection'))->toBe('cockroach') ->and($response->json('config'))->not->toBeEmpty(); });