/** * A test started. * * @param PHPUnit_Framework_Test $test */ public function startTest(PHPUnit_Framework_Test $test) { Mage::dispatchEvent('phpunit_test_start_before', array('test' => $test, 'listener' => $this)); if ($test instanceof PHPUnit_Framework_TestCase) { EcomDev_PHPUnit_Helper::setTestCase($test); EcomDev_PHPUnit_Test_Case_Util::getFixture(get_class($test))->setScope(EcomDev_PHPUnit_Model_FixtureInterface::SCOPE_LOCAL)->loadByTestCase($test); $annotations = $test->getAnnotations(); EcomDev_PHPUnit_Test_Case_Util::getFixture()->setOptions($annotations['method'])->apply(); EcomDev_PHPUnit_Test_Case_Util::setUp(); EcomDev_PHPUnit_Helper::setUp(); } Mage::dispatchEvent('phpunit_test_start_after', array('test' => $test, 'listener' => $this)); }
/** * Test that when set up is invoked, * test helpers that support setUp method invoked as well * */ public function testSetUp() { $helpers = $this->getHelpersForTest(4, true); $helpers[0]->expects($this->never())->method('setUp'); $helpers[1]->expects($this->once())->method('setUp'); $helpers[2]->expects($this->never())->method('setUp'); $helpers[3]->expects($this->once())->method('setUp'); EcomDev_PHPUnit_Helper::setUp(); }