Use getenv
This commit is contained in:
parent
72e89edd4d
commit
d2fdf1d642
@ -55,14 +55,14 @@ abstract class BaseDatabaseTestCase extends PHPUnit\DbUnit\TestCase {
|
||||
|
||||
public static function setUpBeforeClass(): void {
|
||||
if (file_exists(__DIR__ . '/../.env')) {
|
||||
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/..');
|
||||
$dotenv = Dotenv\Dotenv::createUnsafeImmutable(__DIR__ . '/..');
|
||||
$dotenv->load();
|
||||
$dotenv->required(['DB_DSN', 'DB_USER', 'DB_PASS']);
|
||||
}
|
||||
|
||||
$db_dsn = $_ENV['DB_DSN'];
|
||||
$db_user = $_ENV['DB_USER'];
|
||||
$db_pass = $_ENV['DB_PASS'];
|
||||
$db_dsn = getenv('DB_DSN');
|
||||
$db_user = getenv('DB_USER');
|
||||
$db_pass = getenv('DB_PASS');
|
||||
|
||||
// pdo connection
|
||||
if (self::$pdo == null) {
|
||||
|
@ -15,12 +15,12 @@ class UloggerAPITestCase extends BaseDatabaseTestCase {
|
||||
public function setUp(): void {
|
||||
parent::setUp();
|
||||
if (file_exists(__DIR__ . '/../.env')) {
|
||||
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/..');
|
||||
$dotenv = Dotenv\Dotenv::createUnsafeImmutable(__DIR__ . '/..');
|
||||
$dotenv->load();
|
||||
$dotenv->required(['ULOGGER_URL']);
|
||||
}
|
||||
|
||||
$url = $_ENV['ULOGGER_URL'];
|
||||
$url = getenv('ULOGGER_URL');
|
||||
|
||||
$this->http = new GuzzleHttp\Client([ 'base_uri' => $url, 'cookies' => true ]);
|
||||
}
|
||||
|
@ -17,14 +17,14 @@ class UloggerDatabaseTestCase extends BaseDatabaseTestCase {
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
if (file_exists(__DIR__ . '/../.env')) {
|
||||
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/..');
|
||||
$dotenv = Dotenv\Dotenv::createUnsafeImmutable(__DIR__ . '/..');
|
||||
$dotenv->load();
|
||||
$dotenv->required(['DB_DSN', 'DB_USER', 'DB_PASS']);
|
||||
}
|
||||
|
||||
$db_dsn = $_ENV['DB_DSN'];
|
||||
$db_user = $_ENV['DB_USER'];
|
||||
$db_pass = $_ENV['DB_PASS'];
|
||||
$db_dsn = getenv('DB_DSN');
|
||||
$db_user = getenv('DB_USER');
|
||||
$db_pass = getenv('DB_PASS');
|
||||
|
||||
// uDb connection
|
||||
if (self::$udb == null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user