27 \PHPUnit\Framework\TestCase $test,
28 \
Magento\TestFramework\Event\Param\Transaction $param
31 if ($this->_isIsolationActive) {
32 if ($methodIsolation ===
false) {
33 $param->requestTransactionRollback();
36 $param->requestTransactionStart();
47 \PHPUnit\Framework\TestCase $test,
48 \
Magento\TestFramework\Event\Param\Transaction $param
50 if ($this->_isIsolationActive && $this->
_getIsolation($test)) {
51 $param->requestTransactionRollback();
64 $this->_isIsolationActive =
true;
72 $this->_isIsolationActive =
false;
88 $annotations = $this->getAnnotations($test);
89 if (isset($annotations[self::MAGENTO_DB_ISOLATION])) {
91 if ($isolation !== [
'enabled'] && $isolation !== [
'disabled']) {
92 throw new \Magento\Framework\Exception\LocalizedException(
93 __(
'Invalid "@magentoDbIsolation" annotation, can be "enabled" or "disabled" only.')
96 return $isolation === [
'enabled'];
105 private function getAnnotations(\PHPUnit\Framework\TestCase $test)
107 $annotations = $test->getAnnotations();
108 return array_replace($annotations[
'class'], $annotations[
'method']);
endTestTransactionRequest(\PHPUnit\Framework\TestCase $test, \Magento\TestFramework\Event\Param\Transaction $param)
elseif(isset( $params[ 'redirect_parent']))
const MAGENTO_DB_ISOLATION
startTestTransactionRequest(\PHPUnit\Framework\TestCase $test, \Magento\TestFramework\Event\Param\Transaction $param)
_getIsolation(\PHPUnit\Framework\TestCase $test)
startTransaction(\PHPUnit\Framework\TestCase $test)