File size: 458 Bytes
d2897cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php

declare(strict_types=1);

namespace Mautic\CoreBundle\Test;

use Symfony\Component\Dotenv\Dotenv;

final class EnvLoader
{
    /**
     * Loads the env variables from .env(.*) files for PHPUNIT tests.
     */
    public static function load(): void
    {
        $reflection     = new \ReflectionClass(Dotenv::class);
        $vendorRootPath = dirname($reflection->getFileName(), 4);

        (new Dotenv())->loadEnv($vendorRootPath.'/.env');
    }
}