/** * A test ended. * * @param PHPUnit_Framework_Test $test * @param float $time */ public function endTest(PHPUnit_Framework_Test $test, $time) { Mage::dispatchEvent('phpunit_test_end_before', array('test' => $test, 'listener' => $this)); if ($test instanceof PHPUnit_Framework_TestCase) { 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('test' => $test, 'listener' => $this)); }
/** * performs the following cleanup tasks: * - discards fixtures * @return null */ public function tearDown() { Mage::app()->setCurrentStore(Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID); EcomDev_PHPUnit_Test_Case_Util::tearDown(); }