Issue #3418451 by longwave: Remove withConsecutive() in ModuleHandlerTest
parent
501e1ed2fb
commit
267f1252bf
|
@ -3353,11 +3353,6 @@ parameters:
|
|||
count: 1
|
||||
path: tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to deprecated method withConsecutive\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\Builder\\\\InvocationMocker\\.$#"
|
||||
count: 1
|
||||
path: tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to deprecated method withConsecutive\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\Builder\\\\InvocationMocker\\.$#"
|
||||
count: 1
|
||||
|
|
|
@ -115,15 +115,18 @@ class ModuleHandlerTest extends UnitTestCase {
|
|||
])
|
||||
->onlyMethods(['load'])
|
||||
->getMock();
|
||||
$module_handler->expects($this->exactly(3))
|
||||
$calls = [
|
||||
// First reload.
|
||||
'module_handler_test',
|
||||
// Second reload.
|
||||
'module_handler_test',
|
||||
'module_handler_test_added',
|
||||
];
|
||||
$module_handler->expects($this->exactly(count($calls)))
|
||||
->method('load')
|
||||
->withConsecutive(
|
||||
// First reload.
|
||||
['module_handler_test'],
|
||||
// Second reload.
|
||||
['module_handler_test'],
|
||||
['module_handler_test_added'],
|
||||
);
|
||||
->with($this->callback(function (string $module) use (&$calls): bool {
|
||||
return $module === array_shift($calls);
|
||||
}));
|
||||
$module_handler->reload();
|
||||
$module_handler->addModule('module_handler_test_added', 'core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_added');
|
||||
$module_handler->reload();
|
||||
|
|
Loading…
Reference in New Issue