Example #1
0
 /**
  * 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));
 }
Example #2
0
 /**
  * Test that setTestCase method was correctly invoked
  *
  */
 public function testSetTestCase()
 {
     $helpers = $this->getHelpersForTest(4, true);
     // Initialize mock for test
     foreach ($helpers as $helper) {
         $helper->expects($this->once())->method('setTestCase')->with(new PHPUnit_Framework_Constraint_IsIdentical($this))->will($this->returnSelf());
     }
     EcomDev_PHPUnit_Helper::setTestCase($this);
 }