コード例 #1
0
ファイル: DataFixture.php プロジェクト: nemphys/magento2
 /**
  * Handler for 'endTestNeedTransactionRollback' event
  *
  * @param PHPUnit_Framework_TestCase $test
  * @param Magento_Test_Event_Param_Transaction $param
  */
 public function endTestTransactionRequest(PHPUnit_Framework_TestCase $test, Magento_Test_Event_Param_Transaction $param)
 {
     /* Isolate other tests from test-specific fixtures */
     if ($this->_appliedFixtures && $this->_getFixtures('method', $test)) {
         $param->requestTransactionRollback();
     }
 }
コード例 #2
0
 /**
  * Retrieve clean instance of transaction event parameter
  *
  * @return Magento_Test_Event_Param_Transaction
  */
 protected function _getEventParam()
 {
     /* reset object state instead of instantiating new object over and over again */
     if (!$this->_eventParam) {
         $this->_eventParam = new Magento_Test_Event_Param_Transaction();
     } else {
         $this->_eventParam->__construct();
     }
     return $this->_eventParam;
 }
コード例 #3
0
ファイル: TransactionTest.php プロジェクト: nemphys/magento2
 public function testRequestTransactionRollback()
 {
     $this->assertFalse($this->_object->isTransactionRollbackRequested());
     $this->_object->requestTransactionRollback();
     $this->assertTrue($this->_object->isTransactionRollbackRequested());
 }
コード例 #4
0
ファイル: DbIsolation.php プロジェクト: nemphys/magento2
 /**
  * Handler for 'endTestTransactionRequest' event
  *
  * @param PHPUnit_Framework_TestCase $test
  * @param Magento_Test_Event_Param_Transaction $param
  */
 public function endTestTransactionRequest(PHPUnit_Framework_TestCase $test, Magento_Test_Event_Param_Transaction $param)
 {
     if ($this->_isIsolationActive && $this->_getIsolation('method', $test)) {
         $param->requestTransactionRollback();
     }
 }