示例#1
0
 /**
  * Handler for 'endTestNeedTransactionRollback' event
  *
  * @param \PHPUnit_Framework_TestCase $test
  * @param \Magento\TestFramework\Event\Param\Transaction $param
  */
 public function endTestTransactionRequest(\PHPUnit_Framework_TestCase $test, \Magento\TestFramework\Event\Param\Transaction $param)
 {
     /* Isolate other tests from test-specific fixtures */
     if ($this->_appliedFixtures && $this->_getFixtures('method', $test)) {
         $param->requestTransactionRollback();
     }
 }
示例#2
0
 /**
  * Handler for 'endTestNeedTransactionRollback' event
  *
  * @param \PHPUnit_Framework_TestCase $test
  * @param \Magento\TestFramework\Event\Param\Transaction $param
  */
 public function endTestTransactionRequest(\PHPUnit_Framework_TestCase $test, \Magento\TestFramework\Event\Param\Transaction $param)
 {
     /* Isolate other tests from test-specific fixtures */
     if ($this->_appliedFixtures && $this->_getFixtures($test)) {
         if ($this->getDbIsolationState($test) !== ['disabled']) {
             $param->requestTransactionRollback();
         } else {
             $this->_revertFixtures();
         }
     }
 }
示例#3
0
 /**
  * Handler for 'endTestTransactionRequest' event
  *
  * @param \PHPUnit_Framework_TestCase $test
  * @param \Magento\TestFramework\Event\Param\Transaction $param
  */
 public function endTestTransactionRequest(\PHPUnit_Framework_TestCase $test, \Magento\TestFramework\Event\Param\Transaction $param)
 {
     if ($this->_isIsolationActive && $this->_getIsolation($test)) {
         $param->requestTransactionRollback();
     }
 }
示例#4
0
 public function testRequestTransactionRollback()
 {
     $this->assertFalse($this->_object->isTransactionRollbackRequested());
     $this->_object->requestTransactionRollback();
     $this->assertTrue($this->_object->isTransactionRollbackRequested());
 }