diff options
Diffstat (limited to 'tests/Core/Controller/LostControllerTest.php')
-rw-r--r-- | tests/Core/Controller/LostControllerTest.php | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php index 27344102f0a..fdbca1ea3b1 100644 --- a/tests/Core/Controller/LostControllerTest.php +++ b/tests/Core/Controller/LostControllerTest.php @@ -110,9 +110,9 @@ class LostControllerTest extends \Test\TestCase { $this->l10n ->expects($this->any()) ->method('t') - ->will($this->returnCallback(function($text, $parameters = array()) { + ->willReturnCallback(function($text, $parameters = array()) { return vsprintf($text, $parameters); - })); + }); $this->defaults = $this->getMockBuilder('\OCP\Defaults') ->disableOriginalConstructor()->getMock(); $this->userManager = $this->getMockBuilder(IUserManager::class) @@ -179,7 +179,7 @@ class LostControllerTest extends \Test\TestCase { ->with('ValidTokenUser', 'core', 'lostpassword', null) ->willReturn('encryptedToken'); $this->existingUser->method('getLastLogin') - ->will($this->returnValue(12344)); + ->willReturn(12344); $this->userManager->method('get') ->with('ValidTokenUser') ->willReturn($this->existingUser); @@ -210,7 +210,7 @@ class LostControllerTest extends \Test\TestCase { ->expects($this->once()) ->method('getUserValue') ->with('ValidTokenUser', 'core', 'lostpassword', null) - ->will($this->returnValue('encryptedToken')); + ->willReturn('encryptedToken'); $this->crypto->method('decrypt') ->with( $this->equalTo('encryptedToken'), @@ -257,7 +257,7 @@ class LostControllerTest extends \Test\TestCase { ->expects($this->once()) ->method('linkToRouteAbsolute') ->with('core.lost.setPassword', array('userId' => 'ValidTokenUser', 'token' => 'TheOnlyAndOnlyOneTokenToResetThePassword')) - ->will($this->returnValue('https://example.tld/index.php/lostpassword/')); + ->willReturn('https://example.tld/index.php/lostpassword/'); $this->initialStateService->expects($this->at(0)) ->method('provideInitialState') @@ -280,10 +280,10 @@ class LostControllerTest extends \Test\TestCase { $this->userManager ->expects($this->any()) ->method('userExists') - ->will($this->returnValueMap(array( + ->willReturnMap(array( array(true, $existingUser), array(false, $nonExistingUser) - ))); + )); $this->logger->expects($this->exactly(0)) ->method('logException'); @@ -307,7 +307,7 @@ class LostControllerTest extends \Test\TestCase { ->expects($this->any()) ->method('getUserValue') ->with($existingUser, 'settings', 'email') - ->will($this->returnValue(null)); + ->willReturn(null); $response = $this->lostController->email($existingUser); $expectedResponse = new JSONResponse([ 'status' => 'success', @@ -321,7 +321,7 @@ class LostControllerTest extends \Test\TestCase { ->expects($this->once()) ->method('generate') ->with('21') - ->will($this->returnValue('ThisIsMaybeANotSoSecretToken!')); + ->willReturn('ThisIsMaybeANotSoSecretToken!'); $this->userManager ->expects($this->any()) ->method('get') @@ -330,7 +330,7 @@ class LostControllerTest extends \Test\TestCase { $this->timeFactory ->expects($this->once()) ->method('getTime') - ->will($this->returnValue(12348)); + ->willReturn(12348); $this->config ->expects($this->once()) ->method('setUserValue') @@ -339,7 +339,7 @@ class LostControllerTest extends \Test\TestCase { ->expects($this->once()) ->method('linkToRouteAbsolute') ->with('core.lost.resetform', array('userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!')) - ->will($this->returnValue('https://example.tld/index.php/lostpassword/')); + ->willReturn('https://example.tld/index.php/lostpassword/'); $message = $this->getMockBuilder('\OC\Mail\Message') ->disableOriginalConstructor()->getMock(); $message @@ -371,7 +371,7 @@ class LostControllerTest extends \Test\TestCase { $this->mailer ->expects($this->at(1)) ->method('createMessage') - ->will($this->returnValue($message)); + ->willReturn($message); $this->mailer ->expects($this->at(2)) ->method('send') @@ -394,7 +394,7 @@ class LostControllerTest extends \Test\TestCase { ->expects($this->once()) ->method('generate') ->with('21') - ->will($this->returnValue('ThisIsMaybeANotSoSecretToken!')); + ->willReturn('ThisIsMaybeANotSoSecretToken!'); $this->userManager ->expects($this->any()) ->method('get') @@ -408,7 +408,7 @@ class LostControllerTest extends \Test\TestCase { $this->timeFactory ->expects($this->once()) ->method('getTime') - ->will($this->returnValue(12348)); + ->willReturn(12348); $this->config ->expects($this->once()) ->method('setUserValue') @@ -417,7 +417,7 @@ class LostControllerTest extends \Test\TestCase { ->expects($this->once()) ->method('linkToRouteAbsolute') ->with('core.lost.resetform', array('userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!')) - ->will($this->returnValue('https://example.tld/index.php/lostpassword/')); + ->willReturn('https://example.tld/index.php/lostpassword/'); $message = $this->getMockBuilder('\OC\Mail\Message') ->disableOriginalConstructor()->getMock(); $message @@ -449,7 +449,7 @@ class LostControllerTest extends \Test\TestCase { $this->mailer ->expects($this->at(1)) ->method('createMessage') - ->will($this->returnValue($message)); + ->willReturn($message); $this->mailer ->expects($this->at(2)) ->method('send') @@ -472,7 +472,7 @@ class LostControllerTest extends \Test\TestCase { ->expects($this->once()) ->method('generate') ->with('21') - ->will($this->returnValue('ThisIsMaybeANotSoSecretToken!')); + ->willReturn('ThisIsMaybeANotSoSecretToken!'); $this->userManager ->expects($this->any()) ->method('get') @@ -485,12 +485,12 @@ class LostControllerTest extends \Test\TestCase { $this->timeFactory ->expects($this->once()) ->method('getTime') - ->will($this->returnValue(12348)); + ->willReturn(12348); $this->urlGenerator ->expects($this->once()) ->method('linkToRouteAbsolute') ->with('core.lost.resetform', array('userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!')) - ->will($this->returnValue('https://example.tld/index.php/lostpassword/')); + ->willReturn('https://example.tld/index.php/lostpassword/'); $message = $this->createMock(Message::class); $message ->expects($this->at(0)) @@ -521,7 +521,7 @@ class LostControllerTest extends \Test\TestCase { $this->mailer ->expects($this->at(1)) ->method('createMessage') - ->will($this->returnValue($message)); + ->willReturn($message); $this->mailer ->expects($this->at(2)) ->method('send') @@ -548,7 +548,7 @@ class LostControllerTest extends \Test\TestCase { ->with('ValidTokenUser', 'core', 'lostpassword', null) ->willReturn('encryptedData'); $this->existingUser->method('getLastLogin') - ->will($this->returnValue(12344)); + ->willReturn(12344); $this->existingUser->expects($this->once()) ->method('setPassword') ->with('NewPassword') @@ -559,7 +559,7 @@ class LostControllerTest extends \Test\TestCase { $this->config->expects($this->never()) ->method('deleteUserValue'); $this->timeFactory->method('getTime') - ->will($this->returnValue(12348)); + ->willReturn(12348); $this->crypto->method('decrypt') ->with( @@ -577,7 +577,7 @@ class LostControllerTest extends \Test\TestCase { ->with('ValidTokenUser', 'core', 'lostpassword', null) ->willReturn('encryptedData'); $this->existingUser->method('getLastLogin') - ->will($this->returnValue(12344)); + ->willReturn(12344); $this->existingUser->expects($this->once()) ->method('setPassword') ->with('NewPassword') @@ -589,7 +589,7 @@ class LostControllerTest extends \Test\TestCase { ->method('deleteUserValue') ->with('ValidTokenUser', 'core', 'lostpassword'); $this->timeFactory->method('getTime') - ->will($this->returnValue(12348)); + ->willReturn(12348); $this->crypto->method('decrypt') ->with( @@ -654,14 +654,14 @@ class LostControllerTest extends \Test\TestCase { ->with('ValidTokenUser', 'core', 'lostpassword', null) ->willReturn('encryptedData'); $this->existingUser->method('getLastLogin') - ->will($this->returnValue(12346)); + ->willReturn(12346); $this->userManager ->method('get') ->with('ValidTokenUser') ->willReturn($this->existingUser); $this->timeFactory ->method('getTime') - ->will($this->returnValue(12345)); + ->willReturn(12345); $this->crypto->method('decrypt') ->with( @@ -781,7 +781,7 @@ class LostControllerTest extends \Test\TestCase { ->with('ValidTokenUser', 'core', 'lostpassword', null) ->willReturn('encryptedData'); $this->existingUser->method('getLastLogin') - ->will($this->returnValue(12344)); + ->willReturn(12344); $this->existingUser->expects($this->once()) ->method('setPassword') ->with('NewPassword') @@ -793,7 +793,7 @@ class LostControllerTest extends \Test\TestCase { ->method('deleteUserValue') ->with('ValidTokenUser', 'core', 'lostpassword'); $this->timeFactory->method('getTime') - ->will($this->returnValue(12348)); + ->willReturn(12348); $this->crypto->method('decrypt') ->with( |