From 53e41f60070e9cb169a8ff277e797147287e64ff 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 --- eZ/Publish/API/Repository/Tests/BaseTest.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/eZ/Publish/API/Repository/Tests/BaseTest.php b/eZ/Publish/API/Repository/Tests/BaseTest.php index ed0d2fc1dcf..35a3b3b0353 100644 --- a/eZ/Publish/API/Repository/Tests/BaseTest.php +++ b/eZ/Publish/API/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();