summaryrefslogtreecommitdiffstats
path: root/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-25 22:21:27 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-25 22:21:27 +0100
commit2ee65f177e4f7e09ad2287f14d564e7068d322fb (patch)
tree39075e87ea7927e20e8956824cb7c49bf626b178 /tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
parent3cf321fdfc4235a87015a9af2f59c63220016c65 (diff)
downloadnextcloud-server-2ee65f177e4f7e09ad2287f14d564e7068d322fb.tar.gz
nextcloud-server-2ee65f177e4f7e09ad2287f14d564e7068d322fb.zip
Use the shorter phpunit syntax for mocked return values
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/lib/Authentication/TwoFactorAuth/ManagerTest.php')
-rw-r--r--tests/lib/Authentication/TwoFactorAuth/ManagerTest.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
index 63d0e993f3b..b5cea26e73f 100644
--- a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
+++ b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
@@ -126,7 +126,7 @@ class ManagerTest extends TestCase {
private function prepareNoProviders() {
$this->providerLoader->method('getProviders')
->with($this->user)
- ->will($this->returnValue([]));
+ ->willReturn([]);
}
private function prepareProviders() {
@@ -366,11 +366,11 @@ class ManagerTest extends TestCase {
$this->fakeProvider->expects($this->once())
->method('verifyChallenge')
->with($this->user, $challenge)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->session->expects($this->once())
->method('get')
->with('two_factor_remember_login')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->session->expects($this->at(1))
->method('remove')
->with('two_factor_auth_uid');
@@ -449,7 +449,7 @@ class ManagerTest extends TestCase {
$this->fakeProvider->expects($this->once())
->method('verifyChallenge')
->with($this->user, $challenge)
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->session->expects($this->never())
->method('remove');
$this->activityManager->expects($this->once())
@@ -496,7 +496,7 @@ class ManagerTest extends TestCase {
$this->session->expects($this->at(1))
->method('exists')
->with('two_factor_auth_uid')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->session->expects($this->at(2))
->method('exists')
->with(Manager::SESSION_UID_DONE)
@@ -557,7 +557,7 @@ class ManagerTest extends TestCase {
$this->session->expects($this->never())
->method('exists')
->with('two_factor_auth_uid')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->session->expects($this->never())
->method('remove')
->with('two_factor_auth_uid');
@@ -567,7 +567,7 @@ class ManagerTest extends TestCase {
public function testPrepareTwoFactorLogin() {
$this->user->method('getUID')
- ->will($this->returnValue('ferdinand'));
+ ->willReturn('ferdinand');
$this->session->expects($this->at(0))
->method('set')
@@ -597,7 +597,7 @@ class ManagerTest extends TestCase {
public function testPrepareTwoFactorLoginDontRemember() {
$this->user->method('getUID')
- ->will($this->returnValue('ferdinand'));
+ ->willReturn('ferdinand');
$this->session->expects($this->at(0))
->method('set')
@@ -630,14 +630,14 @@ class ManagerTest extends TestCase {
->willReturn('user');
$this->session->method('exists')
- ->will($this->returnCallback(function ($var) {
+ ->willReturnCallback(function ($var) {
if ($var === Manager::SESSION_UID_KEY) {
return false;
} else if ($var === 'app_password') {
return false;
}
return true;
- }));
+ });
$this->session->expects($this->once())
->method('get')
->with(Manager::SESSION_UID_DONE)