Skip to content

Commit d0ad1a1

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: stop using deprecated PHPUnit APIs
2 parents e223165 + 3a78edf commit d0ad1a1

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

Tests/Authentication/Provider/DaoAuthenticationProviderTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ protected function getSupportedToken()
300300

301301
protected function getProvider($user = null, $userChecker = null, $passwordEncoder = null)
302302
{
303-
$userProvider = $this->getMockBuilder([UserProviderInterface::class, PasswordUpgraderInterface::class])->getMock();
303+
$userProvider = $this->getMockBuilder(PasswordUpgraderProvider::class)->getMock();
304304
if (null !== $user) {
305305
$userProvider->expects($this->once())
306306
->method('loadUserByUsername')
@@ -353,3 +353,6 @@ public function eraseCredentials()
353353
{
354354
}
355355
}
356+
interface PasswordUpgraderProvider extends UserProviderInterface, PasswordUpgraderInterface
357+
{
358+
}

Tests/Authentication/Provider/LdapBindAuthenticationProviderTest.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,10 @@ public function testQueryForDn()
112112

113113
$ldap = $this->getMockBuilder(LdapInterface::class)->getMock();
114114
$ldap
115-
->expects($this->at(0))
116115
->method('bind')
117-
->with('elsa', 'test1234A$');
116+
->withConsecutive(
117+
['elsa', 'test1234A$']
118+
);
118119
$ldap
119120
->expects($this->once())
120121
->method('escape')
@@ -152,9 +153,10 @@ public function testQueryWithUserForDn()
152153

153154
$ldap = $this->getMockBuilder(LdapInterface::class)->getMock();
154155
$ldap
155-
->expects($this->at(0))
156156
->method('bind')
157-
->with('elsa', 'test1234A$');
157+
->withConsecutive(
158+
['elsa', 'test1234A$']
159+
);
158160
$ldap
159161
->expects($this->once())
160162
->method('escape')
@@ -195,9 +197,10 @@ public function testEmptyQueryResultShouldThrowAnException()
195197

196198
$ldap = $this->getMockBuilder(LdapInterface::class)->getMock();
197199
$ldap
198-
->expects($this->at(0))
199200
->method('bind')
200-
->with('elsa', 'test1234A$');
201+
->withConsecutive(
202+
['elsa', 'test1234A$']
203+
);
201204
$ldap
202205
->expects($this->once())
203206
->method('query')

0 commit comments

Comments
 (0)