summaryrefslogtreecommitdiffstats
path: root/tests/lib/Encryption/UtilTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Encryption/UtilTest.php')
-rw-r--r--tests/lib/Encryption/UtilTest.php54
1 files changed, 27 insertions, 27 deletions
diff --git a/tests/lib/Encryption/UtilTest.php b/tests/lib/Encryption/UtilTest.php
index 2c5bd1a80f3..0ac474faa0f 100644
--- a/tests/lib/Encryption/UtilTest.php
+++ b/tests/lib/Encryption/UtilTest.php
@@ -101,7 +101,7 @@ class UtilTest extends TestCase {
$this->expectException(\OC\Encryption\Exceptions\EncryptionHeaderKeyExistsException::class);
- $header = array('header1' => 1, 'header2' => 2, 'oc_encryption_module' => 'foo');
+ $header = ['header1' => 1, 'header2' => 2, 'oc_encryption_module' => 'foo'];
$em = $this->createMock(IEncryptionModule::class);
$em->expects($this->any())->method('getId')->willReturn('moduleId');
@@ -120,7 +120,7 @@ class UtilTest extends TestCase {
$this->userManager
->expects($this->any())
->method('userExists')
- ->willReturnCallback(array($this, 'isExcludedCallback'));
+ ->willReturnCallback([$this, 'isExcludedCallback']);
$this->assertSame($expected,
$this->util->isExcluded($path)
@@ -128,17 +128,17 @@ class UtilTest extends TestCase {
}
public function providePathsForTestIsExcluded() {
- return array(
- array('/files_encryption', '', true),
- array('files_encryption/foo.txt', '', true),
- array('test/foo.txt', '', false),
- array('/user1/files_encryption/foo.txt', '', true),
- array('/user1/files/foo.txt', '', false),
- array('/keyStorage/user1/files/foo.txt', 'keyStorage', true),
- array('/keyStorage/files_encryption', '/keyStorage', true),
- array('keyStorage/user1/files_encryption', '/keyStorage/', true),
+ return [
+ ['/files_encryption', '', true],
+ ['files_encryption/foo.txt', '', true],
+ ['test/foo.txt', '', false],
+ ['/user1/files_encryption/foo.txt', '', true],
+ ['/user1/files/foo.txt', '', false],
+ ['/keyStorage/user1/files/foo.txt', 'keyStorage', true],
+ ['/keyStorage/files_encryption', '/keyStorage', true],
+ ['keyStorage/user1/files_encryption', '/keyStorage/', true],
- );
+ ];
}
public function isExcludedCallback() {
@@ -160,15 +160,15 @@ class UtilTest extends TestCase {
}
public function dataTestIsFile() {
- return array(
- array('/user/files/test.txt', true),
- array('/user/files', true),
- array('/user/files_versions/test.txt', false),
- array('/user/foo/files/test.txt', false),
- array('/files/foo/files/test.txt', false),
- array('/user', false),
- array('/user/test.txt', false),
- );
+ return [
+ ['/user/files/test.txt', true],
+ ['/user/files', true],
+ ['/user/files_versions/test.txt', false],
+ ['/user/foo/files/test.txt', false],
+ ['/files/foo/files/test.txt', false],
+ ['/user', false],
+ ['/user/test.txt', false],
+ ];
}
/**
@@ -183,12 +183,12 @@ class UtilTest extends TestCase {
}
public function dataTestStripPartialFileExtension() {
- return array(
- array('/foo/test.txt', '/foo/test.txt'),
- array('/foo/test.txt.part', '/foo/test.txt'),
- array('/foo/test.txt.ocTransferId7567846853.part', '/foo/test.txt'),
- array('/foo/test.txt.ocTransferId7567.part', '/foo/test.txt'),
- );
+ return [
+ ['/foo/test.txt', '/foo/test.txt'],
+ ['/foo/test.txt.part', '/foo/test.txt'],
+ ['/foo/test.txt.ocTransferId7567846853.part', '/foo/test.txt'],
+ ['/foo/test.txt.ocTransferId7567.part', '/foo/test.txt'],
+ ];
}
}