Skip to content
This repository has been archived by the owner on May 27, 2023. It is now read-only.

Improved exception handling on fixture loader #147

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions app/code/community/EcomDev/PHPUnit/Test/Listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down