/** * Handler for 'startTestTransactionRequest' event * * @param \PHPUnit_Framework_TestCase $test * @param \Magento\TestFramework\Event\Param\Transaction $param */ public function startTestTransactionRequest(\PHPUnit_Framework_TestCase $test, \Magento\TestFramework\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\TestFramework\Event\Param\Transaction $param */ public function startTestTransactionRequest(\PHPUnit_Framework_TestCase $test, \Magento\TestFramework\Event\Param\Transaction $param) { /* Start transaction before applying first fixture to be able to revert them all further */ if ($this->_getFixtures($test)) { if ($this->getDbIsolationState($test) !== ['disabled']) { $param->requestTransactionStart(); } else { $this->_applyFixtures($this->_getFixtures($test)); } } }
/** * Handler for 'startTestTransactionRequest' event * * @param \PHPUnit_Framework_TestCase $test * @param \Magento\TestFramework\Event\Param\Transaction $param */ public function startTestTransactionRequest(\PHPUnit_Framework_TestCase $test, \Magento\TestFramework\Event\Param\Transaction $param) { $methodIsolation = $this->_getIsolation($test); if ($this->_isIsolationActive) { if ($methodIsolation === false) { $param->requestTransactionRollback(); } } elseif ($methodIsolation || $methodIsolation === null && $this->_getIsolation($test)) { $param->requestTransactionStart(); } }
public function testRequestTransactionStart() { $this->assertFalse($this->_object->isTransactionStartRequested()); $this->_object->requestTransactionStart(); $this->assertTrue($this->_object->isTransactionStartRequested()); }