Skip to content

Commit e1b7c14

Browse files
minor #49621 [Tests] Remove occurrences of withConsecutive() (alexandre-daubois)
This PR was merged into the 5.4 branch. Discussion ---------- [Tests] Remove occurrences of `withConsecutive()` | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - `withConsecutive()` has been deprecated in PHPUnit 9.6 and removed in PHP 10 (sebastianbergmann/phpunit#4564). This PR aims at starting the work to remove these occurrences. There is unfortunately no given migration path, and this requires manual work. I'll create a meta issue referencing remaining occurrences if this one's merged, to keep track. Some seems pretty hard to remove. cc `@OskarStark` this might interest you, as we worked a lot on tests lately 😄 Commits ------- 2047763649 [Tests] Remove occurrences of `withConsecutive()`
2 parents 8b4a6d5 + a0464e7 commit e1b7c14

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Tests/Config/ContainerParametersResourceCheckerTest.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,17 @@ public static function isFreshProvider()
6464
yield 'fresh on every identical parameters' => [function (MockObject $container) {
6565
$container->expects(self::exactly(2))->method('hasParameter')->willReturn(true);
6666
$container->expects(self::exactly(2))->method('getParameter')
67-
->withConsecutive(
68-
[self::equalTo('locales')],
69-
[self::equalTo('default_locale')]
70-
)
71-
->willReturnMap([
72-
['locales', ['fr', 'en']],
73-
['default_locale', 'fr'],
74-
])
67+
->willReturnCallback(function (...$args) {
68+
static $series = [
69+
[['locales'], ['fr', 'en']],
70+
[['default_locale'], 'fr'],
71+
];
72+
73+
[$expectedArgs, $return] = array_shift($series);
74+
self::assertSame($expectedArgs, $args);
75+
76+
return $return;
77+
})
7578
;
7679
}, true];
7780
}

0 commit comments

Comments
 (0)