aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Core
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-09-19 11:10:31 +0200
committerprovokateurin <kate@provokateurin.de>2024-09-19 14:21:20 +0200
commit9836e9b16484582d309c8437ab46d82e34956941 (patch)
treed3da87bb7dfd1a8877ed25072ecf609def844089 /tests/Core
parent8c60ffa0f21414e6e671c567d664a9b9e5253e26 (diff)
downloadnextcloud-server-9836e9b16484582d309c8437ab46d82e34956941.tar.gz
nextcloud-server-9836e9b16484582d309c8437ab46d82e34956941.zip
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'tests/Core')
-rw-r--r--tests/Core/Command/Log/FileTest.php2
-rw-r--r--tests/Core/Command/Maintenance/ModeTest.php2
-rw-r--r--tests/Core/Command/SystemTag/AddTest.php2
-rw-r--r--tests/Core/Command/SystemTag/EditTest.php6
-rw-r--r--tests/Core/Controller/AppPasswordControllerTest.php4
-rw-r--r--tests/Core/Controller/AvatarControllerTest.php26
-rw-r--r--tests/Core/Controller/ClientFlowLoginControllerTest.php8
-rw-r--r--tests/Core/Controller/ClientFlowLoginV2ControllerTest.php2
-rw-r--r--tests/Core/Service/LoginFlowV2ServiceUnitTest.php2
9 files changed, 27 insertions, 27 deletions
diff --git a/tests/Core/Command/Log/FileTest.php b/tests/Core/Command/Log/FileTest.php
index 08ff01e019d..9c7e0297d53 100644
--- a/tests/Core/Command/Log/FileTest.php
+++ b/tests/Core/Command/Log/FileTest.php
@@ -91,7 +91,7 @@ class FileTest extends TestCase {
$this->config->method('getSystemValue')
->willReturnMap([
['log_type', 'file', 'log_type_value'],
- ['datadirectory', \OC::$SERVERROOT.'/data', '/data/directory/'],
+ ['datadirectory', \OC::$SERVERROOT . '/data', '/data/directory/'],
['logfile', '/data/directory/nextcloud.log', '/var/log/nextcloud.log'],
['log_rotate_size', 100 * 1024 * 1024, 5 * 1024 * 1024],
]);
diff --git a/tests/Core/Command/Maintenance/ModeTest.php b/tests/Core/Command/Maintenance/ModeTest.php
index 59b8bbfc045..a4c33474745 100644
--- a/tests/Core/Command/Maintenance/ModeTest.php
+++ b/tests/Core/Command/Maintenance/ModeTest.php
@@ -123,7 +123,7 @@ class ModeTest extends TestCase {
string $option,
bool $currentMaintenanceState,
$expectedMaintenanceState,
- string $expectedOutput
+ string $expectedOutput,
): void {
$this->config->expects($this->any())
->method('getSystemValueBool')
diff --git a/tests/Core/Command/SystemTag/AddTest.php b/tests/Core/Command/SystemTag/AddTest.php
index 4dd0df7ffe0..7ae832e4079 100644
--- a/tests/Core/Command/SystemTag/AddTest.php
+++ b/tests/Core/Command/SystemTag/AddTest.php
@@ -95,7 +95,7 @@ class AddTest extends TestCase {
$this->systemTagManager->method('createTag')
->willReturnCallback(function ($tagName, $userVisible, $userAssignable) {
throw new TagAlreadyExistsException(
- 'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') already exists'
+ 'Tag ("' . $tagName . '", ' . $userVisible . ', ' . $userAssignable . ') already exists'
);
});
diff --git a/tests/Core/Command/SystemTag/EditTest.php b/tests/Core/Command/SystemTag/EditTest.php
index 1857da25ab0..f2695591905 100644
--- a/tests/Core/Command/SystemTag/EditTest.php
+++ b/tests/Core/Command/SystemTag/EditTest.php
@@ -87,7 +87,7 @@ class EditTest extends TestCase {
$this->output->expects($this->once())
->method('writeln')
->with(
- '<info>Tag updated ("'.$newTagName.'", '.$newTagUserVisible.', '.$newTagUserAssignable.')</info>'
+ '<info>Tag updated ("' . $newTagName . '", ' . $newTagUserVisible . ', ' . $newTagUserAssignable . ')</info>'
);
$this->invokePrivate($this->command, 'execute', [$this->input, $this->output]);
@@ -135,7 +135,7 @@ class EditTest extends TestCase {
$this->systemTagManager->method('updateTag')
->willReturnCallback(function ($tagId, $tagName, $userVisible, $userAssignable) {
throw new TagAlreadyExistsException(
- 'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') already exists'
+ 'Tag ("' . $tagName . '", ' . $userVisible . ', ' . $userAssignable . ') already exists'
);
});
@@ -151,7 +151,7 @@ class EditTest extends TestCase {
$this->output->expects($this->once())
->method('writeln')
->with(
- '<error>Tag ("' . $newTagName . '", '. $newTagUserVisible . ', ' . $newTagUserAssignable . ') already exists</error>'
+ '<error>Tag ("' . $newTagName . '", ' . $newTagUserVisible . ', ' . $newTagUserAssignable . ') already exists</error>'
);
$this->invokePrivate($this->command, 'execute', [$this->input, $this->output]);
diff --git a/tests/Core/Controller/AppPasswordControllerTest.php b/tests/Core/Controller/AppPasswordControllerTest.php
index f0246561145..b33033edac3 100644
--- a/tests/Core/Controller/AppPasswordControllerTest.php
+++ b/tests/Core/Controller/AppPasswordControllerTest.php
@@ -128,7 +128,7 @@ class AppPasswordControllerTest extends TestCase {
$this->random->method('generate')
->with(
72,
- ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS
+ ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS
)->willReturn('myToken');
$this->tokenProvider->expects($this->once())
@@ -169,7 +169,7 @@ class AppPasswordControllerTest extends TestCase {
$this->random->method('generate')
->with(
72,
- ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS
+ ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS
)->willReturn('myToken');
$this->tokenProvider->expects($this->once())
diff --git a/tests/Core/Controller/AvatarControllerTest.php b/tests/Core/Controller/AvatarControllerTest.php
index 3a1123c940b..0dca611b020 100644
--- a/tests/Core/Controller/AvatarControllerTest.php
+++ b/tests/Core/Controller/AvatarControllerTest.php
@@ -309,7 +309,7 @@ class AvatarControllerTest extends \Test\TestCase {
* Fetch tmp avatar
*/
public function testTmpAvatarValid(): void {
- $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
+ $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg'));
$response = $this->avatarController->getTmpAvatar();
$this->assertEquals(Http::STATUS_OK, $response->getStatus());
@@ -331,14 +331,14 @@ class AvatarControllerTest extends \Test\TestCase {
public function testPostAvatarFile(): void {
//Create temp file
$fileName = tempnam('', 'avatarTest');
- $copyRes = copy(\OC::$SERVERROOT.'/tests/data/testimage.jpg', $fileName);
+ $copyRes = copy(\OC::$SERVERROOT . '/tests/data/testimage.jpg', $fileName);
$this->assertTrue($copyRes);
//Create file in cache
- $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
+ $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg'));
//Create request return
- $reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [filesize(\OC::$SERVERROOT.'/tests/data/testimage.jpg')]];
+ $reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [filesize(\OC::$SERVERROOT . '/tests/data/testimage.jpg')]];
$this->request->method('getUploadedFile')->willReturn($reqRet);
$response = $this->avatarController->postAvatar(null);
@@ -369,14 +369,14 @@ class AvatarControllerTest extends \Test\TestCase {
public function testPostAvatarFileGif(): void {
//Create temp file
$fileName = tempnam('', 'avatarTest');
- $copyRes = copy(\OC::$SERVERROOT.'/tests/data/testimage.gif', $fileName);
+ $copyRes = copy(\OC::$SERVERROOT . '/tests/data/testimage.gif', $fileName);
$this->assertTrue($copyRes);
//Create file in cache
- $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.gif'));
+ $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.gif'));
//Create request return
- $reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [filesize(\OC::$SERVERROOT.'/tests/data/testimage.gif')]];
+ $reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [filesize(\OC::$SERVERROOT . '/tests/data/testimage.gif')]];
$this->request->method('getUploadedFile')->willReturn($reqRet);
$response = $this->avatarController->postAvatar(null);
@@ -396,7 +396,7 @@ class AvatarControllerTest extends \Test\TestCase {
->disableOriginalConstructor()->getMock();
$file->expects($this->once())
->method('getContent')
- ->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
+ ->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg'));
$file->expects($this->once())
->method('getMimeType')
->willReturn('image/jpeg');
@@ -474,7 +474,7 @@ class AvatarControllerTest extends \Test\TestCase {
->disableOriginalConstructor()->getMock();
$file->expects($this->once())
->method('getContent')
- ->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
+ ->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg'));
$file->expects($this->once())
->method('getMimeType')
->willReturn('image/jpeg');
@@ -512,7 +512,7 @@ class AvatarControllerTest extends \Test\TestCase {
* Test with non square crop
*/
public function testPostCroppedAvatarNoSquareCrop(): void {
- $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
+ $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->avatarManager->method('getAvatar')->willReturn($this->avatarMock);
@@ -525,7 +525,7 @@ class AvatarControllerTest extends \Test\TestCase {
* Check for proper reply on proper crop argument
*/
public function testPostCroppedAvatarValidCrop(): void {
- $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
+ $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg'));
$this->avatarManager->method('getAvatar')->willReturn($this->avatarMock);
$response = $this->avatarController->postCroppedAvatar(['x' => 0, 'y' => 0, 'w' => 10, 'h' => 10]);
@@ -537,7 +537,7 @@ class AvatarControllerTest extends \Test\TestCase {
* Test what happens if the cropping of the avatar fails
*/
public function testPostCroppedAvatarException(): void {
- $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
+ $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->avatarManager->method('getAvatar')->willReturn($this->avatarMock);
@@ -554,7 +554,7 @@ class AvatarControllerTest extends \Test\TestCase {
* Check for proper reply on proper crop argument
*/
public function testFileTooBig(): void {
- $fileName = \OC::$SERVERROOT.'/tests/data/testimage.jpg';
+ $fileName = \OC::$SERVERROOT . '/tests/data/testimage.jpg';
//Create request return
$reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [21 * 1024 * 1024]];
$this->request->method('getUploadedFile')->willReturn($reqRet);
diff --git a/tests/Core/Controller/ClientFlowLoginControllerTest.php b/tests/Core/Controller/ClientFlowLoginControllerTest.php
index a38f73c85a6..7f9f11db7e3 100644
--- a/tests/Core/Controller/ClientFlowLoginControllerTest.php
+++ b/tests/Core/Controller/ClientFlowLoginControllerTest.php
@@ -137,7 +137,7 @@ class ClientFlowLoginControllerTest extends TestCase {
->method('generate')
->with(
64,
- ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS
+ ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS
)
->willReturn('StateToken');
$this->session
@@ -207,7 +207,7 @@ class ClientFlowLoginControllerTest extends TestCase {
->method('generate')
->with(
64,
- ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS
+ ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS
)
->willReturn('StateToken');
$this->session
@@ -448,8 +448,8 @@ class ClientFlowLoginControllerTest extends TestCase {
[128]
)
->willReturnMap([
- [72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS, 'MyGeneratedToken'],
- [128, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS, 'MyAccessCode'],
+ [72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS, 'MyGeneratedToken'],
+ [128, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS, 'MyAccessCode'],
]);
$user = $this->createMock(IUser::class);
$user
diff --git a/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php b/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php
index 093b8a3442d..98c7821791d 100644
--- a/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php
+++ b/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php
@@ -161,7 +161,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
->willReturn($flow);
$this->random->method('generate')
- ->with(64, ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS)
+ ->with(64, ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS)
->willReturn('random');
$this->session->expects($this->once())
->method('set')
diff --git a/tests/Core/Service/LoginFlowV2ServiceUnitTest.php b/tests/Core/Service/LoginFlowV2ServiceUnitTest.php
index 2fb61a2ef08..1c31efee8f7 100644
--- a/tests/Core/Service/LoginFlowV2ServiceUnitTest.php
+++ b/tests/Core/Service/LoginFlowV2ServiceUnitTest.php
@@ -296,7 +296,7 @@ class LoginFlowV2ServiceUnitTest extends TestCase {
$this->secureRandom->expects($this->once())
->method('generate')
- ->with(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS)
+ ->with(72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS)
->willReturn('test_pass');
// session token