From 4ec003baac456f7981e9ae69922f5662c61c56b8 Mon Sep 17 00:00:00 2001 From: Jim O'Halloran Date: Tue, 1 Oct 2013 13:09:49 +0930 Subject: [PATCH] Improved error messaging when exceptions occur during fixture load --- app/code/community/EcomDev/PHPUnit/Test/Listener.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/code/community/EcomDev/PHPUnit/Test/Listener.php b/app/code/community/EcomDev/PHPUnit/Test/Listener.php index 70fd036d..63831d10 100644 --- a/app/code/community/EcomDev/PHPUnit/Test/Listener.php +++ b/app/code/community/EcomDev/PHPUnit/Test/Listener.php @@ -146,9 +146,15 @@ public function startTest(PHPUnit_Framework_Test $test) ->setScope(EcomDev_PHPUnit_Model_Fixture_Interface::SCOPE_LOCAL) ->loadByTestCase($test); $annotations = $test->getAnnotations(); - EcomDev_PHPUnit_Test_Case_Util::getFixture() - ->setOptions($annotations['method']) - ->apply(); + + try { + EcomDev_PHPUnit_Test_Case_Util::getFixture() + ->setOptions($annotations['method']) + ->apply(); + + } catch (Exception $e) { + throw new Exception("Exception loading fixture for ".$test->toString()." Exception: ".$e->getMessage()." Originally thrown in ".$e->getFile().":".$e->getLine()); + } EcomDev_PHPUnit_Test_Case_Util::setUp(); EcomDev_PHPUnit_Helper::setUp();