Skip to content

Commit c63f733

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 7e9e8d0 + 9d7018b commit c63f733

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Tests/Session/Storage/Handler/StrictSessionHandlerTest.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,18 @@ public function testReadWithValidateIdMismatch()
8484
{
8585
$handler = $this->createMock(\SessionHandlerInterface::class);
8686
$handler->expects($this->exactly(2))->method('read')
87-
->withConsecutive(['id1'], ['id2'])
88-
->will($this->onConsecutiveCalls('data1', 'data2'));
87+
->willReturnCallback(function (...$args) {
88+
static $series = [
89+
[['id1'], 'data1'],
90+
[['id2'], 'data2'],
91+
];
92+
93+
[$expectedArgs, $return] = array_shift($series);
94+
$this->assertSame($expectedArgs, $args);
95+
96+
return $return;
97+
})
98+
;
8999
$proxy = new StrictSessionHandler($handler);
90100

91101
$this->assertTrue($proxy->validateId('id1'));

0 commit comments

Comments
 (0)