We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
withConsecutive()
1 parent 3bb6ee5 commit 9d7018bCopy full SHA for 9d7018b
Tests/Session/Storage/Handler/StrictSessionHandlerTest.php
@@ -84,8 +84,18 @@ public function testReadWithValidateIdMismatch()
84
{
85
$handler = $this->createMock(\SessionHandlerInterface::class);
86
$handler->expects($this->exactly(2))->method('read')
87
- ->withConsecutive(['id1'], ['id2'])
88
- ->will($this->onConsecutiveCalls('data1', 'data2'));
+ ->willReturnCallback(function (...$args) {
+ 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
+ ;
99
$proxy = new StrictSessionHandler($handler);
100
101
$this->assertTrue($proxy->validateId('id1'));
0 commit comments