Skip to content

Commit

Permalink
Testing resolve of non string environment vars
Browse files Browse the repository at this point in the history
  • Loading branch information
misantron committed Jan 18, 2021
1 parent fa3f9cd commit c2f09e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/ConfigServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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']);
}
Expand Down

0 comments on commit c2f09e3

Please sign in to comment.