diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 11:30:18 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 18:34:56 +0300 |
commit | b80ebc96748b45fd2e0ba9323308657c4b00b7ec (patch) | |
tree | ec20e0ffa2f86b9b54939a83a785407319f94559 /tests/Core | |
parent | 62403d0932be7d620c7bdadc6b4e13eb496fcd6f (diff) |
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/Core')
-rw-r--r-- | tests/Core/Controller/ClientFlowLoginControllerTest.php | 2 | ||||
-rw-r--r-- | tests/Core/Controller/LostControllerTest.php | 24 | ||||
-rw-r--r-- | tests/Core/Controller/OCSControllerTest.php | 8 |
3 files changed, 17 insertions, 17 deletions
diff --git a/tests/Core/Controller/ClientFlowLoginControllerTest.php b/tests/Core/Controller/ClientFlowLoginControllerTest.php index cd90918144d..211f08b929f 100644 --- a/tests/Core/Controller/ClientFlowLoginControllerTest.php +++ b/tests/Core/Controller/ClientFlowLoginControllerTest.php @@ -83,7 +83,7 @@ class ClientFlowLoginControllerTest extends TestCase { $this->l10n ->expects($this->any()) ->method('t') - ->willReturnCallback(function($text, $parameters = array()) { + ->willReturnCallback(function($text, $parameters = []) { return vsprintf($text, $parameters); }); $this->defaults = $this->createMock(Defaults::class); diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php index fdbca1ea3b1..750547473b1 100644 --- a/tests/Core/Controller/LostControllerTest.php +++ b/tests/Core/Controller/LostControllerTest.php @@ -110,7 +110,7 @@ class LostControllerTest extends \Test\TestCase { $this->l10n ->expects($this->any()) ->method('t') - ->willReturnCallback(function($text, $parameters = array()) { + ->willReturnCallback(function($text, $parameters = []) { return vsprintf($text, $parameters); }); $this->defaults = $this->getMockBuilder('\OCP\Defaults') @@ -256,7 +256,7 @@ class LostControllerTest extends \Test\TestCase { $this->urlGenerator ->expects($this->once()) ->method('linkToRouteAbsolute') - ->with('core.lost.setPassword', array('userId' => 'ValidTokenUser', 'token' => 'TheOnlyAndOnlyOneTokenToResetThePassword')) + ->with('core.lost.setPassword', ['userId' => 'ValidTokenUser', 'token' => 'TheOnlyAndOnlyOneTokenToResetThePassword']) ->willReturn('https://example.tld/index.php/lostpassword/'); $this->initialStateService->expects($this->at(0)) @@ -280,10 +280,10 @@ class LostControllerTest extends \Test\TestCase { $this->userManager ->expects($this->any()) ->method('userExists') - ->willReturnMap(array( - array(true, $existingUser), - array(false, $nonExistingUser) - )); + ->willReturnMap([ + [true, $existingUser], + [false, $nonExistingUser] + ]); $this->logger->expects($this->exactly(0)) ->method('logException'); @@ -338,7 +338,7 @@ class LostControllerTest extends \Test\TestCase { $this->urlGenerator ->expects($this->once()) ->method('linkToRouteAbsolute') - ->with('core.lost.resetform', array('userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!')) + ->with('core.lost.resetform', ['userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!']) ->willReturn('https://example.tld/index.php/lostpassword/'); $message = $this->getMockBuilder('\OC\Mail\Message') ->disableOriginalConstructor()->getMock(); @@ -416,7 +416,7 @@ class LostControllerTest extends \Test\TestCase { $this->urlGenerator ->expects($this->once()) ->method('linkToRouteAbsolute') - ->with('core.lost.resetform', array('userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!')) + ->with('core.lost.resetform', ['userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!']) ->willReturn('https://example.tld/index.php/lostpassword/'); $message = $this->getMockBuilder('\OC\Mail\Message') ->disableOriginalConstructor()->getMock(); @@ -489,7 +489,7 @@ class LostControllerTest extends \Test\TestCase { $this->urlGenerator ->expects($this->once()) ->method('linkToRouteAbsolute') - ->with('core.lost.resetform', array('userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!')) + ->with('core.lost.resetform', ['userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!']) ->willReturn('https://example.tld/index.php/lostpassword/'); $message = $this->createMock(Message::class); $message @@ -568,7 +568,7 @@ class LostControllerTest extends \Test\TestCase { )->willReturn('12345:TheOnlyAndOnlyOneTokenToResetThePassword'); $response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', true); - $expectedResponse = array('status' => 'error', 'msg' => ''); + $expectedResponse = ['status' => 'error', 'msg' => '']; $this->assertSame($expectedResponse, $response); } @@ -598,7 +598,7 @@ class LostControllerTest extends \Test\TestCase { )->willReturn('12345:TheOnlyAndOnlyOneTokenToResetThePassword'); $response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', true); - $expectedResponse = array('user' => 'ValidTokenUser', 'status' => 'success'); + $expectedResponse = ['user' => 'ValidTokenUser', 'status' => 'success']; $this->assertSame($expectedResponse, $response); } @@ -802,7 +802,7 @@ class LostControllerTest extends \Test\TestCase { )->willReturn('12345:TheOnlyAndOnlyOneTokenToResetThePassword'); $response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', false); - $expectedResponse = array('user' => 'ValidTokenUser', 'status' => 'success'); + $expectedResponse = ['user' => 'ValidTokenUser', 'status' => 'success']; $this->assertSame($expectedResponse, $response); } diff --git a/tests/Core/Controller/OCSControllerTest.php b/tests/Core/Controller/OCSControllerTest.php index f0fbce86b8c..af776274e5c 100644 --- a/tests/Core/Controller/OCSControllerTest.php +++ b/tests/Core/Controller/OCSControllerTest.php @@ -92,14 +92,14 @@ class OCSControllerTest extends TestCase { list($major, $minor, $micro) = \OCP\Util::getVersion(); $result = []; - $result['version'] = array( + $result['version'] = [ 'major' => $major, 'minor' => $minor, 'micro' => $micro, 'string' => \OC_Util::getVersionString(), 'edition' => '', 'extendedSupport' => false - ); + ]; $capabilities = [ 'foo' => 'bar', @@ -124,14 +124,14 @@ class OCSControllerTest extends TestCase { list($major, $minor, $micro) = \OCP\Util::getVersion(); $result = []; - $result['version'] = array( + $result['version'] = [ 'major' => $major, 'minor' => $minor, 'micro' => $micro, 'string' => \OC_Util::getVersionString(), 'edition' => '', 'extendedSupport' => false - ); + ]; $capabilities = [ 'foo' => 'bar', |