File tree 1 file changed +17
-0
lines changed
Filter options
src/Symfony/Bridge/PhpUnit 1 file changed +17
-0
lines changed
Original file line number Diff line number Diff line change 35
35
}
36
36
}
37
37
38
+ // load an .env.test file for override phpunit.xml(.dist) vars
39
+ $ path = dirname (getenv ('SYMFONY_PHPUNIT_DIR ' ), 2 );
40
+ if (file_exists ($ path .'/vendor/autoload.php ' )) {
41
+ $ loader = clone require $ path .'/vendor/autoload.php ' ;
42
+ if (!class_exists (\Symfony \Component \Dotenv \Dotenv::class)) {
43
+ throw new \RuntimeException ('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application. ' );
44
+ }
45
+
46
+ $ dotenv = new \Symfony \Component \Dotenv \Dotenv ();
47
+ $ path .= '/.env. ' .(false !== getenv ('APP_ENV ' ) ? getenv ('APP_ENV ' ): 'test ' );
48
+ if (file_exists ($ p = $ path )) {
49
+ $ dotenv ->load ($ p );
50
+ }
51
+
52
+ $ loader ->unregister ();
53
+ }
54
+
38
55
if ('disabled ' !== getenv ('SYMFONY_DEPRECATIONS_HELPER ' )) {
39
56
DeprecationErrorHandler::register (getenv ('SYMFONY_DEPRECATIONS_HELPER ' ));
40
57
}
You can’t perform that action at this time.
0 commit comments