aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Core
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Core')
-rw-r--r--tests/Core/Command/User/AddTest.php4
-rw-r--r--tests/Core/Controller/AvatarControllerTest.php12
-rw-r--r--tests/Core/Controller/ChangePasswordControllerTest.php2
-rw-r--r--tests/Core/Controller/LostControllerTest.php2
-rw-r--r--tests/Core/Controller/TwoFactorChallengeControllerTest.php2
5 files changed, 11 insertions, 11 deletions
diff --git a/tests/Core/Command/User/AddTest.php b/tests/Core/Command/User/AddTest.php
index 91535ea6670..546061fc2f0 100644
--- a/tests/Core/Command/User/AddTest.php
+++ b/tests/Core/Command/User/AddTest.php
@@ -111,11 +111,11 @@ class AddTest extends TestCase {
->method('sendMail');
$this->consoleInput->method('getOption')
- ->will(static::returnValueMap([
+ ->willReturnMap([
['generate-password', 'true'],
['email', $email],
['group', []],
- ]));
+ ]);
$this->invokePrivate($this->addCommand, 'execute', [
$this->consoleInput,
diff --git a/tests/Core/Controller/AvatarControllerTest.php b/tests/Core/Controller/AvatarControllerTest.php
index 0dca611b020..4bda1713351 100644
--- a/tests/Core/Controller/AvatarControllerTest.php
+++ b/tests/Core/Controller/AvatarControllerTest.php
@@ -130,7 +130,7 @@ class AvatarControllerTest extends \Test\TestCase {
*/
public function testGetAvatarNoAvatar(): void {
$this->avatarManager->method('getAvatar')->willReturn($this->avatarMock);
- $this->avatarMock->method('getFile')->will($this->throwException(new NotFoundException()));
+ $this->avatarMock->method('getFile')->willThrowException(new NotFoundException());
$response = $this->avatarController->getAvatar('userId', 32);
//Comment out until JS is fixed
@@ -183,7 +183,7 @@ class AvatarControllerTest extends \Test\TestCase {
$this->avatarManager
->method('getAvatar')
->with('userDoesNotExist')
- ->will($this->throwException(new \Exception('user does not exist')));
+ ->willThrowException(new \Exception('user does not exist'));
$response = $this->avatarController->getAvatar('userDoesNotExist', 32);
@@ -287,7 +287,7 @@ class AvatarControllerTest extends \Test\TestCase {
* Test what happens if the removing of the avatar fails
*/
public function testDeleteAvatarException(): void {
- $this->avatarMock->method('remove')->will($this->throwException(new \Exception('foo')));
+ $this->avatarMock->method('remove')->willThrowException(new \Exception('foo'));
$this->avatarManager->method('getAvatar')->willReturn($this->avatarMock);
$this->logger->expects($this->once())
@@ -469,7 +469,7 @@ class AvatarControllerTest extends \Test\TestCase {
public function testPostAvatarException(): void {
$this->cache->expects($this->once())
->method('set')
- ->will($this->throwException(new \Exception('foo')));
+ ->willThrowException(new \Exception('foo'));
$file = $this->getMockBuilder('OCP\Files\File')
->disableOriginalConstructor()->getMock();
$file->expects($this->once())
@@ -514,7 +514,7 @@ class AvatarControllerTest extends \Test\TestCase {
public function testPostCroppedAvatarNoSquareCrop(): void {
$this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg'));
- $this->avatarMock->method('set')->will($this->throwException(new \OC\NotSquareException));
+ $this->avatarMock->method('set')->willThrowException(new \OC\NotSquareException);
$this->avatarManager->method('getAvatar')->willReturn($this->avatarMock);
$response = $this->avatarController->postCroppedAvatar(['x' => 0, 'y' => 0, 'w' => 10, 'h' => 11]);
@@ -539,7 +539,7 @@ class AvatarControllerTest extends \Test\TestCase {
public function testPostCroppedAvatarException(): void {
$this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg'));
- $this->avatarMock->method('set')->will($this->throwException(new \Exception('foo')));
+ $this->avatarMock->method('set')->willThrowException(new \Exception('foo'));
$this->avatarManager->method('getAvatar')->willReturn($this->avatarMock);
$this->logger->expects($this->once())
diff --git a/tests/Core/Controller/ChangePasswordControllerTest.php b/tests/Core/Controller/ChangePasswordControllerTest.php
index a806b091477..91d23c1104e 100644
--- a/tests/Core/Controller/ChangePasswordControllerTest.php
+++ b/tests/Core/Controller/ChangePasswordControllerTest.php
@@ -96,7 +96,7 @@ class ChangePasswordControllerTest extends \Test\TestCase {
$user->expects($this->once())
->method('setPassword')
->with('new')
- ->will($this->throwException(new HintException('Common password')));
+ ->willThrowException(new HintException('Common password'));
$expects = new JSONResponse([
'status' => 'error',
diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php
index cf52a6efb70..e6d99a6523e 100644
--- a/tests/Core/Controller/LostControllerTest.php
+++ b/tests/Core/Controller/LostControllerTest.php
@@ -403,7 +403,7 @@ class LostControllerTest extends TestCase {
->expects($this->once())
->method('send')
->with($message)
- ->will($this->throwException(new \Exception()));
+ ->willThrowException(new \Exception());
$this->logger->expects($this->exactly(1))
->method('error');
diff --git a/tests/Core/Controller/TwoFactorChallengeControllerTest.php b/tests/Core/Controller/TwoFactorChallengeControllerTest.php
index 6f7f64225a3..d9ea1ca263f 100644
--- a/tests/Core/Controller/TwoFactorChallengeControllerTest.php
+++ b/tests/Core/Controller/TwoFactorChallengeControllerTest.php
@@ -301,7 +301,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$this->twoFactorManager->expects($this->once())
->method('verifyChallenge')
->with('myprovider', $user, 'token')
- ->will($this->throwException($exception));
+ ->willThrowException($exception);
$calls = [
['two_factor_auth_error_message', '2FA failed'],
['two_factor_auth_error', true],