/** * Handler for 'startTestTransactionRequest' event * * @param PHPUnit_Framework_TestCase $test * @param Magento_Test_Event_Param_Transaction $param */ public function startTestTransactionRequest(PHPUnit_Framework_TestCase $test, Magento_Test_Event_Param_Transaction $param) { /* Start transaction before applying first fixture to be able to revert them all further */ if ($this->_getFixtures('method', $test)) { /* Re-apply even the same fixtures to guarantee data consistency */ if ($this->_appliedFixtures) { $param->requestTransactionRollback(); } $param->requestTransactionStart(); } else { if (!$this->_appliedFixtures && $this->_getFixtures('class', $test)) { $param->requestTransactionStart(); } } }
/** * Handler for 'startTestTransactionRequest' event * * @param PHPUnit_Framework_TestCase $test * @param Magento_Test_Event_Param_Transaction $param */ public function startTestTransactionRequest(PHPUnit_Framework_TestCase $test, Magento_Test_Event_Param_Transaction $param) { $methodIsolation = $this->_getIsolation('method', $test); if ($this->_isIsolationActive) { if ($methodIsolation === false) { $param->requestTransactionRollback(); } } else { if ($methodIsolation || $methodIsolation === null && $this->_getIsolation('class', $test)) { $param->requestTransactionStart(); } } }
public function testRequestTransactionStart() { $this->assertFalse($this->_object->isTransactionStartRequested()); $this->_object->requestTransactionStart(); $this->assertTrue($this->_object->isTransactionStartRequested()); }