Definition at line 12 of file Transaction.php.
◆ __construct()
Constructor
- Parameters
-
\Magento\TestFramework\EventManager | $eventManager | |
Definition at line 34 of file Transaction.php.
36 $this->_eventManager = $eventManager;
◆ _getEventParam()
Retrieve clean instance of transaction event parameter
- Returns
- \Magento\TestFramework\Event\Param\Transaction
Definition at line 140 of file Transaction.php.
143 if (!$this->_eventParam) {
144 $this->_eventParam = new \Magento\TestFramework\Event\Param\Transaction();
146 $this->_eventParam->__construct();
◆ _processTransactionRequests()
_processTransactionRequests |
( |
|
$eventName, |
|
|
\PHPUnit\Framework\TestCase |
$test |
|
) |
| |
|
protected |
Query whether there are any requests for transaction operations and performs them
- Parameters
-
string | $eventName | |
\PHPUnit\Framework\TestCase | $test | |
Definition at line 73 of file Transaction.php.
76 $this->_eventManager->fireEvent($eventName .
'TransactionRequest', [$test, $param]);
77 if ($param->isTransactionRollbackRequested()) {
80 if ($param->isTransactionStartRequested()) {
_startTransaction(\PHPUnit\Framework\TestCase $test)
◆ _rollbackTransaction()
Rollback transaction and fire 'rollbackTransaction' event
Definition at line 110 of file Transaction.php.
112 if ($this->_isTransactionActive) {
113 $this->_getConnection()->rollbackTransparentTransaction();
114 $this->_isTransactionActive =
false;
115 $this->_eventManager->fireEvent(
'rollbackTransaction');
116 $this->_getConnection()->closeConnection();
◆ _startTransaction()
_startTransaction |
( |
\PHPUnit\Framework\TestCase |
$test | ) |
|
|
protected |
Start transaction and fire 'startTransaction' event
- Parameters
-
\PHPUnit\Framework\TestCase | $test | |
Definition at line 90 of file Transaction.php.
92 if (!$this->_isTransactionActive) {
93 $this->_getConnection()->beginTransparentTransaction();
94 $this->_isTransactionActive =
true;
96 $this->_eventManager->fireEvent(
'startTransaction', [$test]);
97 }
catch (\Exception $e) {
98 $test->getTestResultObject()->addFailure(
100 new \PHPUnit\Framework\AssertionFailedError((
string)$e),
◆ endTest()
endTest |
( |
\PHPUnit\Framework\TestCase |
$test | ) |
|
Handler for 'endTest' event
- Parameters
-
\PHPUnit\Framework\TestCase | $test | |
Definition at line 54 of file Transaction.php.
_processTransactionRequests($eventName, \PHPUnit\Framework\TestCase $test)
◆ endTestSuite()
◆ startTest()
startTest |
( |
\PHPUnit\Framework\TestCase |
$test | ) |
|
Handler for 'startTest' event
- Parameters
-
\PHPUnit\Framework\TestCase | $test | |
Definition at line 44 of file Transaction.php.
_processTransactionRequests($eventName, \PHPUnit\Framework\TestCase $test)
◆ $_eventManager
◆ $_eventParam
◆ $_isTransactionActive
$_isTransactionActive = false |
|
protected |
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/dev/tests/integration/framework/Magento/TestFramework/Event/Transaction.php