Skip to content

Commit 3763b88

Browse files
Test Fixes for PHPUnit10
1 parent dfa9a87 commit 3763b88

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Event/TransactionTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ protected function _imitateTransactionStartRequest($eventName)
5757
};
5858
$this->_eventManager
5959
->method('fireEvent')
60-
->withConsecutive([$eventName])
6160
->willReturnOnConsecutiveCalls($this->returnCallback($callback));
6261
}
6362

@@ -83,7 +82,6 @@ protected function _imitateTransactionRollbackRequest($eventName)
8382
};
8483
$this->_eventManager
8584
->method('fireEvent')
86-
->withConsecutive([$eventName])
8785
->willReturnOnConsecutiveCalls($this->returnCallback($callback));
8886
}
8987

@@ -115,10 +113,10 @@ public function testStartAndRollbackTransaction($method, $eventName)
115113

116114
$this->_eventManager
117115
->method('fireEvent')
118-
->withConsecutive($eventManagerWithArgs);
116+
->with($eventManagerWithArgs);
119117
}
120118

121-
public function startAndRollbackTransactionDataProvider()
119+
public static function startAndRollbackTransactionDataProvider()
122120
{
123121
return [
124122
'method "startTest"' => ['startTest', 'startTestTransactionRequest'],
@@ -153,7 +151,11 @@ public function testEndTestSuiteRollbackTransaction()
153151
$this->_expectTransactionRollback();
154152
$this->_eventManager
155153
->method('fireEvent')
156-
->withConsecutive(['rollbackTransaction']);
154+
->willReturnCallback(function ($arg) {
155+
if ($arg === 'rollbackTransaction') {
156+
return null;
157+
}
158+
});
157159

158160
$this->_object->endTestSuite();
159161
}

0 commit comments

Comments
 (0)