Fix loading of config options as env vars

This commit is contained in:
Alejandro Celaya
2022-08-08 19:23:16 +02:00
parent 6378e614b0
commit a2f9742cfc
3 changed files with 19 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ namespace ShlinkioTest\Shlink\Core\Config;
use PHPUnit\Framework\TestCase;
use Shlinkio\Shlink\Core\Config\EnvVars;
use function Functional\map;
use function putenv;
class EnvVarsTest extends TestCase
@@ -58,4 +59,11 @@ class EnvVarsTest extends TestCase
yield 'DB_DRIVER without default' => [EnvVars::DB_DRIVER, null, null];
yield 'DB_DRIVER with default' => [EnvVars::DB_DRIVER, 'foobar', 'foobar'];
}
/** @test */
public function allValuesCanBeListed(): void
{
$expected = map(EnvVars::cases(), static fn (EnvVars $envVar) => $envVar->value);
self::assertEquals(EnvVars::values(), $expected);
}
}