Skip to content

Commit 3a78edf

Browse files
committed
stop using deprecated PHPUnit APIs
1 parent 7b9df9d commit 3a78edf

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

Tests/Authentication/Provider/DaoAuthenticationProviderTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ protected function getSupportedToken()
303303

304304
protected function getProvider($user = null, $userChecker = null, $passwordEncoder = null)
305305
{
306-
$userProvider = $this->getMockBuilder([UserProviderInterface::class, PasswordUpgraderInterface::class])->getMock();
306+
$userProvider = $this->getMockBuilder(PasswordUpgraderProvider::class)->getMock();
307307
if (null !== $user) {
308308
$userProvider->expects($this->once())
309309
->method('loadUserByUsername')
@@ -329,3 +329,7 @@ protected function getProvider($user = null, $userChecker = null, $passwordEncod
329329
return new DaoAuthenticationProvider($userProvider, $userChecker, 'key', $encoderFactory);
330330
}
331331
}
332+
333+
interface PasswordUpgraderProvider extends UserProviderInterface, PasswordUpgraderInterface
334+
{
335+
}

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)