From ea6d3abffb65b9ec9a9d4eb04638d6e9cf089b11 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Fri, 22 Sep 2017 10:33:47 +0200 Subject: [PATCH] [Integration] Improved SetupFactory exception msgs to be user friendly --- Repository/Tests/BaseTest.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Repository/Tests/BaseTest.php b/Repository/Tests/BaseTest.php index ed0d2fc1d..35a3b3b03 100644 --- a/Repository/Tests/BaseTest.php +++ b/Repository/Tests/BaseTest.php @@ -158,12 +158,19 @@ protected function getSetupFactory() { if (null === $this->setupFactory) { if (false === isset($_ENV['setupFactory'])) { - throw new \ErrorException('Missing mandatory setting $_ENV["setupFactory"].'); + throw new \ErrorException( + 'Missing mandatory setting $_ENV["setupFactory"]. You are trying to run integration tests. Use one of the available phpunit-integration-*.xml configurations' + ); } $setupClass = $_ENV['setupFactory']; if (false === class_exists($setupClass)) { - throw new \ErrorException('$_ENV["setupFactory"] does not reference an existing class.'); + throw new \ErrorException( + sprintf( + '$_ENV["setupFactory"] does not reference an existing class. Class %s does not exist. Did you forget to install a dependency?', + $setupClass + ) + ); } $this->setupFactory = new $setupClass();