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( diff --git a/app/code/community/EcomDev/PHPUnit/bootstrap.php b/app/code/community/EcomDev/PHPUnit/bootstrap.php index 772b395e..8a3154c9 100644 --- a/app/code/community/EcomDev/PHPUnit/bootstrap.php +++ b/app/code/community/EcomDev/PHPUnit/bootstrap.php @@ -51,6 +51,11 @@ ) ); - @include $filePath . '.php'; + $classFile = $filePath . '.php'; + if (stream_resolve_include_path($classFile)) { + return include $classFile; + } else { + return false; + } }); }