From d43846d1e379aaa2b9e6d7498db25f5d3060497e Mon Sep 17 00:00:00 2001 From: Pavel Date: Wed, 19 Jun 2019 11:56:39 +0300 Subject: [PATCH] Make .env file unnecessary for tests --- tests/bootstrap.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index d5251eb..7255d36 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -12,4 +12,9 @@ $loader->add('RetailCrm\\Mg\\Bot\\Test', __DIR__); use Symfony\Component\Dotenv\Dotenv; $dotenv = new Dotenv(); -$dotenv->load(__DIR__ . '/../.env'); + +try { + $dotenv->load(__DIR__ . '/../.env'); +} catch (Exception $exception) { + echo "WARNING: Can't load .env file. Using default environment."; +}