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

Commit

Permalink
Fix issue with current store code
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanChepurnyi committed Oct 31, 2014
1 parent f4397a1 commit cdc2129
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/code/community/EcomDev/PHPUnit/Test/Case/Util.php
Expand Up @@ -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();
}

/**
Expand Down
6 changes: 3 additions & 3 deletions app/code/community/EcomDev/PHPUnit/Test/Listener.php
Expand Up @@ -173,16 +173,16 @@ 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

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(
Expand Down

0 comments on commit cdc2129

Please sign in to comment.