diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-07-24 13:50:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-24 13:50:27 +0200 |
commit | 71f1ef9c1d0f826df5fa23c96b46575f1231f79c (patch) | |
tree | 42bff0fc7f61ac076ecf689f37a76d5f3ee13c88 /apps/files_sharing/tests | |
parent | 6c29f632614ff03f2eeb6a187066e9158fbfed19 (diff) | |
parent | 6d4731024a18b7497dc19eefa97393eae7a3617b (diff) | |
download | nextcloud-server-71f1ef9c1d0f826df5fa23c96b46575f1231f79c.tar.gz nextcloud-server-71f1ef9c1d0f826df5fa23c96b46575f1231f79c.zip |
Merge pull request #5845 from nextcloud/phpstorm_inspect3
Some app fixes of phpstorm inspections
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r-- | apps/files_sharing/tests/BackendTest.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/tests/CapabilitiesTest.php | 3 | ||||
-rw-r--r-- | apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php | 1 | ||||
-rw-r--r-- | apps/files_sharing/tests/HelperTest.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/tests/MountProviderTest.php | 1 | ||||
-rw-r--r-- | apps/files_sharing/tests/SharedMountTest.php | 18 | ||||
-rw-r--r-- | apps/files_sharing/tests/SizePropagationTest.php | 1 | ||||
-rw-r--r-- | apps/files_sharing/tests/UnshareChildrenTest.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/tests/UpdaterTest.php | 8 |
9 files changed, 17 insertions, 21 deletions
diff --git a/apps/files_sharing/tests/BackendTest.php b/apps/files_sharing/tests/BackendTest.php index cea8762a5b4..b9c7f0e813d 100644 --- a/apps/files_sharing/tests/BackendTest.php +++ b/apps/files_sharing/tests/BackendTest.php @@ -68,7 +68,7 @@ class BackendTest extends TestCase { parent::tearDown(); } - function testGetParents() { + public function testGetParents() { $fileinfo1 = $this->view->getFileInfo($this->folder); $fileinfo2 = $this->view->getFileInfo($this->folder . $this->subfolder . $this->subsubfolder); diff --git a/apps/files_sharing/tests/CapabilitiesTest.php b/apps/files_sharing/tests/CapabilitiesTest.php index 663adc1f271..1747bbc4ed2 100644 --- a/apps/files_sharing/tests/CapabilitiesTest.php +++ b/apps/files_sharing/tests/CapabilitiesTest.php @@ -24,8 +24,7 @@ namespace OCA\Files_Sharing\Tests; use OCA\Files_Sharing\Capabilities; -use OCA\Files_Sharing\Tests\TestCase; -use OCP\App\IAppManager; + /** * Class CapabilitiesTest diff --git a/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php b/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php index 5dcf7f83105..827fcc15797 100644 --- a/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php +++ b/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php @@ -22,7 +22,6 @@ namespace OCA\Files_Sharing\Tests\Command; use OCA\Files_Sharing\Command\CleanupRemoteStorages; -use OCP\DB\QueryBuilder\IQueryBuilder; use Test\TestCase; /** diff --git a/apps/files_sharing/tests/HelperTest.php b/apps/files_sharing/tests/HelperTest.php index d5fe83f44e2..e1e73ee82c2 100644 --- a/apps/files_sharing/tests/HelperTest.php +++ b/apps/files_sharing/tests/HelperTest.php @@ -35,7 +35,7 @@ class HelperTest extends TestCase { /** * test set and get share folder */ - function testSetGetShareFolder() { + public function testSetGetShareFolder() { $this->assertSame('/', \OCA\Files_Sharing\Helper::getShareFolder()); \OCA\Files_Sharing\Helper::setShareFolder('/Shared/Folder'); diff --git a/apps/files_sharing/tests/MountProviderTest.php b/apps/files_sharing/tests/MountProviderTest.php index b700d417ad4..04476987a32 100644 --- a/apps/files_sharing/tests/MountProviderTest.php +++ b/apps/files_sharing/tests/MountProviderTest.php @@ -33,7 +33,6 @@ use OCP\IUser; use OCP\IUserManager; use OCP\Share\IShare; use OCP\Share\IManager; -use OCP\Files\Mount\IMountPoint; /** * @group DB diff --git a/apps/files_sharing/tests/SharedMountTest.php b/apps/files_sharing/tests/SharedMountTest.php index 72cc891e368..6f21bd3b92d 100644 --- a/apps/files_sharing/tests/SharedMountTest.php +++ b/apps/files_sharing/tests/SharedMountTest.php @@ -54,8 +54,8 @@ class SharedMountTest extends TestCase { $this->view->mkdir($this->folder); // save file with content - $this->view->file_put_contents($this->filename, "root file"); - $this->view->file_put_contents($this->folder . $this->filename, "file in subfolder"); + $this->view->file_put_contents($this->filename, 'root file'); + $this->view->file_put_contents($this->folder . $this->filename, 'file in subfolder'); $this->groupManager = \OC::$server->getGroupManager(); $this->userManager = \OC::$server->getUserManager(); @@ -204,18 +204,18 @@ class SharedMountTest extends TestCase { $this->assertTrue(\OC\Files\Filesystem::file_exists($this->filename)); - \OC\Files\Filesystem::rename($this->filename, "newFileName"); + \OC\Files\Filesystem::rename($this->filename, 'newFileName'); $this->assertTrue(\OC\Files\Filesystem::file_exists('newFileName')); $this->assertFalse(\OC\Files\Filesystem::file_exists($this->filename)); self::loginHelper(self::TEST_FILES_SHARING_API_USER3); $this->assertTrue(\OC\Files\Filesystem::file_exists($this->filename)); - $this->assertFalse(\OC\Files\Filesystem::file_exists("newFileName")); + $this->assertFalse(\OC\Files\Filesystem::file_exists('newFileName')); self::loginHelper(self::TEST_FILES_SHARING_API_USER3); $this->assertTrue(\OC\Files\Filesystem::file_exists($this->filename)); - $this->assertFalse(\OC\Files\Filesystem::file_exists("newFileName")); + $this->assertFalse(\OC\Files\Filesystem::file_exists('newFileName')); //cleanup self::loginHelper(self::TEST_FILES_SHARING_API_USER1); @@ -240,7 +240,7 @@ class SharedMountTest extends TestCase { if ($exception) { $this->assertSame(10, $e->getCode()); } else { - $this->assertTrue(false, "Exception catched, but expected: " . $expectedResult); + $this->assertTrue(false, 'Exception catched, but expected: ' . $expectedResult); } } } @@ -323,7 +323,7 @@ class SharedMountTest extends TestCase { * * @dataProvider dataPermissionMovedGroupShare */ - function testPermissionMovedGroupShare($type, $beforePerm, $afterPerm) { + public function testPermissionMovedGroupShare($type, $beforePerm, $afterPerm) { if ($type === 'file') { $path = $this->filename; @@ -355,7 +355,7 @@ class SharedMountTest extends TestCase { $this->assertEquals($beforePerm, $result->getPermissions()); // Now move the item forcing a new entry in the share table - \OC\Files\Filesystem::rename($path, "newPath"); + \OC\Files\Filesystem::rename($path, 'newPath'); $this->assertTrue(\OC\Files\Filesystem::file_exists('newPath')); $this->assertFalse(\OC\Files\Filesystem::file_exists($path)); @@ -388,7 +388,7 @@ class SharedMountTest extends TestCase { * If the permissions on a group share are upgraded be sure to still respect * removed shares by a member of that group */ - function testPermissionUpgradeOnUserDeletedGroupShare() { + public function testPermissionUpgradeOnUserDeletedGroupShare() { $testGroup = $this->groupManager->createGroup('testGroup'); $user1 = $this->userManager->get(self::TEST_FILES_SHARING_API_USER1); $user2 = $this->userManager->get(self::TEST_FILES_SHARING_API_USER2); diff --git a/apps/files_sharing/tests/SizePropagationTest.php b/apps/files_sharing/tests/SizePropagationTest.php index 9d80633b46a..f7ad9057959 100644 --- a/apps/files_sharing/tests/SizePropagationTest.php +++ b/apps/files_sharing/tests/SizePropagationTest.php @@ -26,7 +26,6 @@ namespace OCA\Files_Sharing\Tests; use OC\Files\View; -use Test\Traits\MountProviderTrait; use Test\Traits\UserTrait; /** diff --git a/apps/files_sharing/tests/UnshareChildrenTest.php b/apps/files_sharing/tests/UnshareChildrenTest.php index 2bde37af20e..ce7767d1920 100644 --- a/apps/files_sharing/tests/UnshareChildrenTest.php +++ b/apps/files_sharing/tests/UnshareChildrenTest.php @@ -74,7 +74,7 @@ class UnshareChildrenTest extends TestCase { /** * @medium */ - function testUnshareChildren() { + public function testUnshareChildren() { $fileInfo2 = \OC\Files\Filesystem::getFileInfo($this->folder); diff --git a/apps/files_sharing/tests/UpdaterTest.php b/apps/files_sharing/tests/UpdaterTest.php index bb320336d48..c35bcf1a08c 100644 --- a/apps/files_sharing/tests/UpdaterTest.php +++ b/apps/files_sharing/tests/UpdaterTest.php @@ -69,7 +69,7 @@ class UpdaterTest extends TestCase { * points should be unshared before the folder gets deleted so * that the mount point doesn't end up at the trash bin */ - function testDeleteParentFolder() { + public function testDeleteParentFolder() { $status = \OC_App::isEnabled('files_trashbin'); (new \OC_App())->enable('files_trashbin'); @@ -96,8 +96,8 @@ class UpdaterTest extends TestCase { $foldersShared = \OCP\Share::getItemsSharedWith('folder'); $this->assertSame(1, count($foldersShared)); - $view->mkdir("localFolder"); - $view->file_put_contents("localFolder/localFile.txt", "local file"); + $view->mkdir('localFolder'); + $view->file_put_contents('localFolder/localFile.txt', 'local file'); $view->rename($this->folder, 'localFolder/' . $this->folder); @@ -196,7 +196,7 @@ class UpdaterTest extends TestCase { /** * if a folder gets renamed all children mount points should be renamed too */ - function testRename() { + public function testRename() { $fileinfo = \OC\Files\Filesystem::getFileInfo($this->folder); |