From cdc212971a6f69f22f7e4b68826559d4c2427d0b Mon Sep 17 00:00:00 2001 From: Ivan Chepurnyi Date: Fri, 31 Oct 2014 10:23:50 +0100 Subject: [PATCH] Fix issue with current store code --- app/code/community/EcomDev/PHPUnit/Test/Case/Util.php | 1 + app/code/community/EcomDev/PHPUnit/Test/Listener.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/code/community/EcomDev/PHPUnit/Test/Case/Util.php b/app/code/community/EcomDev/PHPUnit/Test/Case/Util.php index d8388851..72fd9f54 100644 --- a/app/code/community/EcomDev/PHPUnit/Test/Case/Util.php +++ b/app/code/community/EcomDev/PHPUnit/Test/Case/Util.php @@ -511,6 +511,7 @@ public static function getGroupedClassMockBuilder(PHPUnit_Framework_TestCase $te public static function setUp() { self::app()->resetDispatchedEvents(); + self::$originalStore = Mage::app()->getStore()->getCode(); } /** diff --git a/app/code/community/EcomDev/PHPUnit/Test/Listener.php b/app/code/community/EcomDev/PHPUnit/Test/Listener.php index aa8ee806..f9d043f8 100644 --- a/app/code/community/EcomDev/PHPUnit/Test/Listener.php +++ b/app/code/community/EcomDev/PHPUnit/Test/Listener.php @@ -173,6 +173,9 @@ public function endTest(PHPUnit_Framework_Test $test, $time) )); if ($test instanceof PHPUnit_Framework_TestCase) { + EcomDev_PHPUnit_Helper::tearDown(); + EcomDev_PHPUnit_Test_Case_Util::tearDown(); + EcomDev_PHPUnit_Test_Case_Util::getFixture(get_class($test)) ->setScope(EcomDev_PHPUnit_Model_FixtureInterface::SCOPE_LOCAL) ->discard(); // Clear applied fixture @@ -180,9 +183,6 @@ public function endTest(PHPUnit_Framework_Test $test, $time) if (EcomDev_PHPUnit_Test_Case_Util::getExpectation(get_class($test))->isLoaded()) { EcomDev_PHPUnit_Test_Case_Util::getExpectation(get_class($test))->discard(); } - - EcomDev_PHPUnit_Test_Case_Util::tearDown(); - EcomDev_PHPUnit_Helper::tearDown(); } Mage::dispatchEvent('phpunit_test_end_after', array(