diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/encryption/tests/lib/HookManagerTest.php | 4 | ||||
-rw-r--r-- | apps/encryption/tests/lib/KeyManagerTest.php | 6 | ||||
-rw-r--r-- | apps/encryption/tests/lib/MigrationTest.php | 2 | ||||
-rw-r--r-- | apps/encryption/tests/lib/RecoveryTest.php | 2 | ||||
-rw-r--r-- | apps/encryption/tests/lib/crypto/cryptTest.php | 20 | ||||
-rw-r--r-- | apps/encryption/tests/lib/crypto/encryptionTest.php | 10 | ||||
-rw-r--r-- | apps/files_sharing/tests/external/managertest.php | 20 | ||||
-rw-r--r-- | apps/files_sharing/tests/middleware/sharingcheckmiddleware.php | 6 |
8 files changed, 35 insertions, 35 deletions
diff --git a/apps/encryption/tests/lib/HookManagerTest.php b/apps/encryption/tests/lib/HookManagerTest.php index 3da0bafb691..fb74c05546b 100644 --- a/apps/encryption/tests/lib/HookManagerTest.php +++ b/apps/encryption/tests/lib/HookManagerTest.php @@ -43,7 +43,7 @@ class HookManagerTest extends TestCase { $this->getMock('NotIHook') ]); - $hookInstances = \Test_Helper::invokePrivate(self::$instance, 'hookInstances'); + $hookInstances = self::invokePrivate(self::$instance, 'hookInstances'); // Make sure our type checking works $this->assertCount(2, $hookInstances); } @@ -66,7 +66,7 @@ class HookManagerTest extends TestCase { $mock = $this->getMockBuilder('OCA\Encryption\Hooks\Contracts\IHook')->disableOriginalConstructor()->getMock(); self::$instance->registerHook($mock); - $hookInstances = \Test_Helper::invokePrivate(self::$instance, 'hookInstances'); + $hookInstances = self::invokePrivate(self::$instance, 'hookInstances'); $this->assertCount(3, $hookInstances); } diff --git a/apps/encryption/tests/lib/KeyManagerTest.php b/apps/encryption/tests/lib/KeyManagerTest.php index 6e9c6d15818..eb43d5a843f 100644 --- a/apps/encryption/tests/lib/KeyManagerTest.php +++ b/apps/encryption/tests/lib/KeyManagerTest.php @@ -285,7 +285,7 @@ class KeyManagerTest extends TestCase { ->with('user1', 'privateKey') ->willReturn(true); - $this->assertTrue(\Test_Helper::invokePrivate($this->instance, + $this->assertTrue(self::invokePrivate($this->instance, 'deletePrivateKey', [$this->userId])); } @@ -329,8 +329,8 @@ class KeyManagerTest extends TestCase { }); // set key IDs - \Test_Helper::invokePrivate($this->instance, 'publicShareKeyId', [$publicShareKeyId]); - \Test_Helper::invokePrivate($this->instance, 'recoveryKeyId', [$recoveryKeyId]); + self::invokePrivate($this->instance, 'publicShareKeyId', [$publicShareKeyId]); + self::invokePrivate($this->instance, 'recoveryKeyId', [$recoveryKeyId]); $result = $this->instance->addSystemKeys($accessList, $publicKeys, $uid); diff --git a/apps/encryption/tests/lib/MigrationTest.php b/apps/encryption/tests/lib/MigrationTest.php index f56ff5cc2f7..c876cea05c9 100644 --- a/apps/encryption/tests/lib/MigrationTest.php +++ b/apps/encryption/tests/lib/MigrationTest.php @@ -292,7 +292,7 @@ class MigrationTest extends \Test\TestCase { public function testUpdateFileCache() { $this->prepareFileCache(); $m = new Migration(\OC::$server->getConfig(), new \OC\Files\View(), \OC::$server->getDatabaseConnection()); - \Test_Helper::invokePrivate($m, 'updateFileCache'); + self::invokePrivate($m, 'updateFileCache'); // check results diff --git a/apps/encryption/tests/lib/RecoveryTest.php b/apps/encryption/tests/lib/RecoveryTest.php index 5bfafa3a98e..0b85192690b 100644 --- a/apps/encryption/tests/lib/RecoveryTest.php +++ b/apps/encryption/tests/lib/RecoveryTest.php @@ -180,7 +180,7 @@ class RecoveryTest extends TestCase { $this->keyManagerMock->expects($this->once()) ->method('setAllFileKeys'); - $this->assertNull(\Test_Helper::invokePrivate($this->instance, + $this->assertNull(self::invokePrivate($this->instance, 'recoverFile', ['/', 'testkey', 'admin'])); } diff --git a/apps/encryption/tests/lib/crypto/cryptTest.php b/apps/encryption/tests/lib/crypto/cryptTest.php index 4114adb115a..f850725108b 100644 --- a/apps/encryption/tests/lib/crypto/cryptTest.php +++ b/apps/encryption/tests/lib/crypto/cryptTest.php @@ -70,7 +70,7 @@ class cryptTest extends TestCase { ->with($this->equalTo('openssl'), $this->equalTo([])) ->willReturn(array()); - $result = \Test_Helper::invokePrivate($this->crypt, 'getOpenSSLConfig'); + $result = self::invokePrivate($this->crypt, 'getOpenSSLConfig'); $this->assertSame(1, count($result)); $this->assertArrayHasKey('private_key_bits', $result); $this->assertSame(4096, $result['private_key_bits']); @@ -86,7 +86,7 @@ class cryptTest extends TestCase { ->with($this->equalTo('openssl'), $this->equalTo([])) ->willReturn(array('foo' => 'bar', 'private_key_bits' => 1028)); - $result = \Test_Helper::invokePrivate($this->crypt, 'getOpenSSLConfig'); + $result = self::invokePrivate($this->crypt, 'getOpenSSLConfig'); $this->assertSame(2, count($result)); $this->assertArrayHasKey('private_key_bits', $result); $this->assertArrayHasKey('foo', $result); @@ -146,7 +146,7 @@ class cryptTest extends TestCase { */ public function testConcatIV() { - $result = \Test_Helper::invokePrivate( + $result = self::invokePrivate( $this->crypt, 'concatIV', array('content', 'my_iv')); @@ -161,7 +161,7 @@ class cryptTest extends TestCase { */ public function testSplitIV() { $data = 'encryptedContent00iv001234567890123456'; - $result = \Test_Helper::invokePrivate($this->crypt, 'splitIV', array($data)); + $result = self::invokePrivate($this->crypt, 'splitIV', array($data)); $this->assertTrue(is_array($result)); $this->assertSame(2, count($result)); $this->assertArrayHasKey('encrypted', $result); @@ -174,7 +174,7 @@ class cryptTest extends TestCase { * test addPadding() */ public function testAddPadding() { - $result = \Test_Helper::invokePrivate($this->crypt, 'addPadding', array('data')); + $result = self::invokePrivate($this->crypt, 'addPadding', array('data')); $this->assertSame('dataxx', $result); } @@ -186,7 +186,7 @@ class cryptTest extends TestCase { * @param $expected */ public function testRemovePadding($data, $expected) { - $result = \Test_Helper::invokePrivate($this->crypt, 'removePadding', array($data)); + $result = self::invokePrivate($this->crypt, 'removePadding', array($data)); $this->assertSame($expected, $result); } @@ -208,7 +208,7 @@ class cryptTest extends TestCase { public function testParseHeader() { $header= 'HBEGIN:foo:bar:cipher:AES-256-CFB:HEND'; - $result = \Test_Helper::invokePrivate($this->crypt, 'parseHeader', array($header)); + $result = self::invokePrivate($this->crypt, 'parseHeader', array($header)); $this->assertTrue(is_array($result)); $this->assertSame(2, count($result)); @@ -227,12 +227,12 @@ class cryptTest extends TestCase { $decrypted = 'content'; $password = 'password'; - $iv = \Test_Helper::invokePrivate($this->crypt, 'generateIv'); + $iv = self::invokePrivate($this->crypt, 'generateIv'); $this->assertTrue(is_string($iv)); $this->assertSame(16, strlen($iv)); - $result = \Test_Helper::invokePrivate($this->crypt, 'encrypt', array($decrypted, $iv, $password)); + $result = self::invokePrivate($this->crypt, 'encrypt', array($decrypted, $iv, $password)); $this->assertTrue(is_string($result)); @@ -251,7 +251,7 @@ class cryptTest extends TestCase { */ public function testDecrypt($data) { - $result = \Test_Helper::invokePrivate( + $result = self::invokePrivate( $this->crypt, 'decrypt', array($data['encrypted'], $data['iv'], $data['password'])); diff --git a/apps/encryption/tests/lib/crypto/encryptionTest.php b/apps/encryption/tests/lib/crypto/encryptionTest.php index d33aff877bf..c6c0d57eff5 100644 --- a/apps/encryption/tests/lib/crypto/encryptionTest.php +++ b/apps/encryption/tests/lib/crypto/encryptionTest.php @@ -103,8 +103,8 @@ class EncryptionTest extends TestCase { */ public function endTest() { // prepare internal variables - \Test_Helper::invokePrivate($this->instance, 'isWriteOperation', [true]); - \Test_Helper::invokePrivate($this->instance, 'writeCache', ['']); + self::invokePrivate($this->instance, 'isWriteOperation', [true]); + self::invokePrivate($this->instance, 'writeCache', ['']); $this->keyManagerMock->expects($this->any()) ->method('getPublicKey') @@ -142,7 +142,7 @@ class EncryptionTest extends TestCase { */ public function testGetPathToRealFile($path, $expected) { $this->assertSame($expected, - \Test_Helper::invokePrivate($this->instance, 'getPathToRealFile', array($path)) + self::invokePrivate($this->instance, 'getPathToRealFile', array($path)) ); } @@ -184,9 +184,9 @@ class EncryptionTest extends TestCase { $this->assertArrayHasKey('cipher', $result); $this->assertSame($expected, $result['cipher']); if ($mode === 'w') { - $this->assertTrue(\Test_Helper::invokePrivate($this->instance, 'isWriteOperation')); + $this->assertTrue(self::invokePrivate($this->instance, 'isWriteOperation')); } else { - $this->assertFalse(\Test_Helper::invokePrivate($this->instance, 'isWriteOperation')); + $this->assertFalse(self::invokePrivate($this->instance, 'isWriteOperation')); } } diff --git a/apps/files_sharing/tests/external/managertest.php b/apps/files_sharing/tests/external/managertest.php index f7b216530d5..df01ea0f738 100644 --- a/apps/files_sharing/tests/external/managertest.php +++ b/apps/files_sharing/tests/external/managertest.php @@ -76,7 +76,7 @@ class ManagerTest extends TestCase { $this->assertCount(1, $openShares); $this->assertExternalShareEntry($shareData1, $openShares[0], 1, '{{TemporaryMountPointName#' . $shareData1['name'] . '}}'); - \Test_Helper::invokePrivate($this->manager, 'setupMounts'); + self::invokePrivate($this->manager, 'setupMounts'); $this->assertNotMount('SharedFolder'); $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}'); @@ -88,7 +88,7 @@ class ManagerTest extends TestCase { // New share falls back to "-1" appendix, because the name is already taken $this->assertExternalShareEntry($shareData2, $openShares[1], 2, '{{TemporaryMountPointName#' . $shareData2['name'] . '}}-1'); - \Test_Helper::invokePrivate($this->manager, 'setupMounts'); + self::invokePrivate($this->manager, 'setupMounts'); $this->assertNotMount('SharedFolder'); $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}'); $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}-1'); @@ -101,7 +101,7 @@ class ManagerTest extends TestCase { $this->manager->acceptShare($openShares[0]['id']); // Check remaining shares - Accepted - $acceptedShares = \Test_Helper::invokePrivate($this->manager, 'getShares', [true]); + $acceptedShares = self::invokePrivate($this->manager, 'getShares', [true]); $this->assertCount(1, $acceptedShares); $shareData1['accepted'] = true; $this->assertExternalShareEntry($shareData1, $acceptedShares[0], 1, $shareData1['name']); @@ -110,7 +110,7 @@ class ManagerTest extends TestCase { $this->assertCount(1, $openShares); $this->assertExternalShareEntry($shareData2, $openShares[0], 2, '{{TemporaryMountPointName#' . $shareData2['name'] . '}}-1'); - \Test_Helper::invokePrivate($this->manager, 'setupMounts'); + self::invokePrivate($this->manager, 'setupMounts'); $this->assertMount($shareData1['name']); $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}'); $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}-1'); @@ -123,7 +123,7 @@ class ManagerTest extends TestCase { // New share falls back to the original name (no "-\d", because the name is not taken) $this->assertExternalShareEntry($shareData3, $openShares[1], 3, '{{TemporaryMountPointName#' . $shareData3['name'] . '}}'); - \Test_Helper::invokePrivate($this->manager, 'setupMounts'); + self::invokePrivate($this->manager, 'setupMounts'); $this->assertMount($shareData1['name']); $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}'); $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}-1'); @@ -135,13 +135,13 @@ class ManagerTest extends TestCase { // Decline the third share $this->manager->declineShare($openShares[1]['id']); - \Test_Helper::invokePrivate($this->manager, 'setupMounts'); + self::invokePrivate($this->manager, 'setupMounts'); $this->assertMount($shareData1['name']); $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}'); $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}-1'); // Check remaining shares - Accepted - $acceptedShares = \Test_Helper::invokePrivate($this->manager, 'getShares', [true]); + $acceptedShares = self::invokePrivate($this->manager, 'getShares', [true]); $this->assertCount(1, $acceptedShares); $shareData1['accepted'] = true; $this->assertExternalShareEntry($shareData1, $acceptedShares[0], 1, $shareData1['name']); @@ -150,7 +150,7 @@ class ManagerTest extends TestCase { $this->assertCount(1, $openShares); $this->assertExternalShareEntry($shareData2, $openShares[0], 2, '{{TemporaryMountPointName#' . $shareData2['name'] . '}}-1'); - \Test_Helper::invokePrivate($this->manager, 'setupMounts'); + self::invokePrivate($this->manager, 'setupMounts'); $this->assertMount($shareData1['name']); $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}'); $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}-1'); @@ -163,10 +163,10 @@ class ManagerTest extends TestCase { ->with($this->stringStartsWith('http://localhost/ocs/v1.php/cloud/shares/' . $acceptedShares[0]['remote_id'] . '/decline'), $this->anything()); $this->manager->removeUserShares($this->uid); - $this->assertEmpty(\Test_Helper::invokePrivate($this->manager, 'getShares', [null]), 'Asserting all shares for the user have been deleted'); + $this->assertEmpty(self::invokePrivate($this->manager, 'getShares', [null]), 'Asserting all shares for the user have been deleted'); $this->mountManager->clear(); - \Test_Helper::invokePrivate($this->manager, 'setupMounts'); + self::invokePrivate($this->manager, 'setupMounts'); $this->assertNotMount($shareData1['name']); $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}'); $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}-1'); diff --git a/apps/files_sharing/tests/middleware/sharingcheckmiddleware.php b/apps/files_sharing/tests/middleware/sharingcheckmiddleware.php index b1113e7a455..c52036e6f5b 100644 --- a/apps/files_sharing/tests/middleware/sharingcheckmiddleware.php +++ b/apps/files_sharing/tests/middleware/sharingcheckmiddleware.php @@ -58,7 +58,7 @@ class SharingCheckMiddlewareTest extends \Test\TestCase { ->with('core', 'shareapi_allow_links', 'yes') ->will($this->returnValue('yes')); - $this->assertTrue(\Test_Helper::invokePrivate($this->sharingCheckMiddleware, 'isSharingEnabled')); + $this->assertTrue(self::invokePrivate($this->sharingCheckMiddleware, 'isSharingEnabled')); } public function testIsSharingEnabledWithAppDisabled() { @@ -68,7 +68,7 @@ class SharingCheckMiddlewareTest extends \Test\TestCase { ->with('files_sharing') ->will($this->returnValue(false)); - $this->assertFalse(\Test_Helper::invokePrivate($this->sharingCheckMiddleware, 'isSharingEnabled')); + $this->assertFalse(self::invokePrivate($this->sharingCheckMiddleware, 'isSharingEnabled')); } public function testIsSharingEnabledWithSharingDisabled() { @@ -84,6 +84,6 @@ class SharingCheckMiddlewareTest extends \Test\TestCase { ->with('core', 'shareapi_allow_links', 'yes') ->will($this->returnValue('no')); - $this->assertFalse(\Test_Helper::invokePrivate($this->sharingCheckMiddleware, 'isSharingEnabled')); + $this->assertFalse(self::invokePrivate($this->sharingCheckMiddleware, 'isSharingEnabled')); } } |