mirror of
https://github.com/flarum/framework.git
synced 2025-01-20 05:32:49 +08:00
Test setup: Do not use env() helper
Not needed, and not working without a full Laravel installation.
This commit is contained in:
parent
f6347dcc46
commit
484933db7d
|
@ -14,12 +14,12 @@ use Flarum\Install\Installation;
|
||||||
|
|
||||||
require __DIR__.'/../../vendor/autoload.php';
|
require __DIR__.'/../../vendor/autoload.php';
|
||||||
|
|
||||||
$host = env('DB_HOST', 'localhost');
|
$host = getenv('DB_HOST') ?: 'localhost';
|
||||||
$port = intval(env('DB_PORT', 3306));
|
$port = intval(getenv('DB_PORT') ?: 3306);
|
||||||
$name = env('DB_DATABASE', 'flarum_test');
|
$name = getenv('DB_DATABASE') ?: 'flarum_test';
|
||||||
$user = env('DB_USERNAME', 'root');
|
$user = getenv('DB_USERNAME') ?: 'root';
|
||||||
$pass = env('DB_PASSWORD', '');
|
$pass = getenv('DB_PASSWORD') ?: '';
|
||||||
$pref = env('DB_PREFIX', '');
|
$pref = getenv('DB_PREFIX') ?: '';
|
||||||
|
|
||||||
echo "Connecting to database $name at $host:$port.\n";
|
echo "Connecting to database $name at $host:$port.\n";
|
||||||
echo "Logging in as $user with password '$pass'.\n";
|
echo "Logging in as $user with password '$pass'.\n";
|
||||||
|
@ -48,15 +48,9 @@ $pipeline = $installation
|
||||||
->configPath('config.php')
|
->configPath('config.php')
|
||||||
->debugMode(true)
|
->debugMode(true)
|
||||||
->baseUrl(BaseUrl::fromString('http://localhost'))
|
->baseUrl(BaseUrl::fromString('http://localhost'))
|
||||||
->databaseConfig(new DatabaseConfig(
|
->databaseConfig(
|
||||||
'mysql',
|
new DatabaseConfig('mysql', $host, $port, $name, $user, $pass, $pref)
|
||||||
env('DB_HOST', 'localhost'),
|
)
|
||||||
intval(env('DB_PORT', 3306)),
|
|
||||||
env('DB_DATABASE', 'flarum_test'),
|
|
||||||
env('DB_USERNAME', 'root'),
|
|
||||||
env('DB_PASSWORD', ''),
|
|
||||||
env('DB_PREFIX', '')
|
|
||||||
))
|
|
||||||
->adminUser(new AdminUser(
|
->adminUser(new AdminUser(
|
||||||
'admin',
|
'admin',
|
||||||
'secret',
|
'secret',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user