Skip to content

Commit 683fc14

Browse files
committed
Merge branch 'ACP2E-3846' of https://github.com/adobe-commerce-tier-4/magento2ce into PR-05-01-2025
2 parents 5a095a6 + f0ba634 commit 683fc14

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

dev/tests/integration/framework/Magento/TestFramework/Event/Transaction.php

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2012 Adobe
4+
* All Rights Reserved.
55
*/
66

77
namespace Magento\TestFramework\Event;
@@ -94,30 +94,7 @@ protected function _startTransaction(\PHPUnit\Framework\TestCase $test)
9494
if (!$this->_isTransactionActive) {
9595
$this->_getConnection()->beginTransparentTransaction();
9696
$this->_isTransactionActive = true;
97-
try {
98-
/**
99-
* Add any warning during transaction execution as a failure.
100-
*/
101-
set_error_handler(
102-
function ($errNo, $errStr, $errFile, $errLine) use ($test) {
103-
$errMsg = sprintf("%s: %s in %s:%s.", "Warning", $errStr, $errFile, $errLine);
104-
$test->getTestResultObject()->addError($test, new \PHPUnit\Framework\Warning($errMsg), 0);
105-
106-
// Allow error to be handled by next error handler
107-
return false;
108-
},
109-
E_WARNING
110-
);
111-
$this->_eventManager->fireEvent('startTransaction', [$test]);
112-
restore_error_handler();
113-
} catch (\Exception $e) {
114-
$this->_isTransactionActive = false;
115-
$test->getTestResultObject()->addFailure(
116-
$test,
117-
new \PHPUnit\Framework\AssertionFailedError((string)$e),
118-
0
119-
);
120-
}
97+
$this->_eventManager->fireEvent('startTransaction', [$test]);
12198
}
12299
}
123100

0 commit comments

Comments
 (0)