Skip to content

Commit e3ed865

Browse files
alexandre-dauboisnicolas-grekas
authored andcommitted
[Tests] Remove occurrences of withConsecutive()
1 parent 5e41bc0 commit e3ed865

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

Tests/Security/CheckLdapCredentialsListenerTest.php

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,15 @@ public function toArray(): array
170170

171171
$this->ldap
172172
->method('bind')
173-
->withConsecutive(
174-
['elsa', 'test1234A$']
175-
);
173+
->willReturnCallback(function (...$args) {
174+
static $series = [
175+
['elsa', 'test1234A$'],
176+
['', 's3cr3t'],
177+
];
178+
179+
$this->assertSame(array_shift($series), $args);
180+
})
181+
;
176182
$this->ldap->expects($this->any())->method('escape')->with('Wouter', '', LdapInterface::ESCAPE_FILTER)->willReturn('wouter');
177183
$this->ldap->expects($this->once())->method('query')->with('{username}', 'wouter_test')->willReturn($query);
178184

@@ -192,9 +198,15 @@ public function testEmptyQueryResultShouldThrowAnException()
192198

193199
$this->ldap
194200
->method('bind')
195-
->withConsecutive(
196-
['elsa', 'test1234A$']
197-
);
201+
->willReturnCallback(function (...$args) {
202+
static $series = [
203+
['elsa', 'test1234A$'],
204+
['', 's3cr3t'],
205+
];
206+
207+
$this->assertSame(array_shift($series), $args);
208+
})
209+
;
198210
$this->ldap->method('escape')->willReturnArgument(0);
199211
$this->ldap->expects($this->once())->method('query')->willReturn($query);
200212

0 commit comments

Comments
 (0)