From c2f09e3f00e5e3d87418fb13138406d23f38bfee Mon Sep 17 00:00:00 2001 From: Aleksandr Ivanov Date: Mon, 18 Jan 2021 17:45:21 +0300 Subject: [PATCH] Testing resolve of non string environment vars --- tests/ConfigServiceProviderTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/ConfigServiceProviderTest.php b/tests/ConfigServiceProviderTest.php index 15632bb..db37240 100644 --- a/tests/ConfigServiceProviderTest.php +++ b/tests/ConfigServiceProviderTest.php @@ -95,10 +95,12 @@ public function testRegisterWithEnvironmentVariables(): void { $root = realpath(__DIR__ . '/..'); + putenv('APP_ENV=true'); putenv('DATABASE_URL=mysql://localhost:3306'); putenv('ROOT_PATH=%ROOT_PATH%'); $this->createFile('env.json', null, json_encode([ + 'debug' => '%env(bool:APP_ENV)%', 'db.dsn' => '%env(string:DATABASE_URL)%', 'root.path' => '%env(string:ROOT_PATH)%', ], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR)); @@ -109,6 +111,7 @@ public function testRegisterWithEnvironmentVariables(): void ['ROOT_PATH' => $root] )); + self::assertTrue($app['debug']); self::assertSame('mysql://localhost:3306', $app['db.dsn']); self::assertSame($root, $app['root.path']); }