@@ -124,7 +124,7 @@ |
||
| 124 | 124 | * @UseSession |
| 125 | 125 | * |
| 126 | 126 | * Authenticates against password-protected shares |
| 127 | - * @param $token |
|
| 127 | + * @param string $token |
|
| 128 | 128 | * @param string $password |
| 129 | 129 | * @return RedirectResponse|TemplateResponse |
| 130 | 130 | */ |
@@ -27,7 +27,6 @@ |
||
| 27 | 27 | use OCP\App\IAppManager; |
| 28 | 28 | use OCP\AppFramework\Http\NotFoundResponse; |
| 29 | 29 | use OCP\AppFramework\Middleware; |
| 30 | -use OCP\AppFramework\Http\TemplateResponse; |
|
| 31 | 30 | use OCP\Files\NotFoundException; |
| 32 | 31 | use OCP\IConfig; |
| 33 | 32 | use OCP\AppFramework\Utility\IControllerMethodReflector; |
@@ -53,6 +53,11 @@ |
||
| 53 | 53 | */ |
| 54 | 54 | private $user; |
| 55 | 55 | |
| 56 | + /** |
|
| 57 | + * @param string $storage |
|
| 58 | + * @param string $mountpoint |
|
| 59 | + * @param \OCP\Files\Storage\IStorageFactory $loader |
|
| 60 | + */ |
|
| 56 | 61 | public function __construct($storage, $mountpoint, $arguments = null, $loader = null) { |
| 57 | 62 | // first update the mount point before creating the parent |
| 58 | 63 | $this->ownerPropagator = $arguments['propagator']; |
@@ -32,8 +32,6 @@ |
||
| 32 | 32 | |
| 33 | 33 | use OC\Files\Filesystem; |
| 34 | 34 | use OCA\Files_Sharing\ISharedStorage; |
| 35 | -use OCA\Files_Sharing\Propagator; |
|
| 36 | -use OCA\Files_Sharing\SharedMount; |
|
| 37 | 35 | use OCP\Lock\ILockingProvider; |
| 38 | 36 | |
| 39 | 37 | /** |
@@ -144,6 +144,9 @@ |
||
| 144 | 144 | return true; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | + /** |
|
| 148 | + * @param string $path |
|
| 149 | + */ |
|
| 147 | 150 | public function url_stat($path) { |
| 148 | 151 | if (isset(self::$data[$path])) { |
| 149 | 152 | $size = strlen(self::$data[$path]); |
@@ -81,6 +81,10 @@ discard block |
||
| 81 | 81 | ); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | + /** |
|
| 85 | + * @param string $uid |
|
| 86 | + * @param string $displayName |
|
| 87 | + */ |
|
| 84 | 88 | protected function getUserMock($uid, $displayName) { |
| 85 | 89 | $user = $this->getMockBuilder('OCP\IUser') |
| 86 | 90 | ->disableOriginalConstructor() |
@@ -97,6 +101,9 @@ discard block |
||
| 97 | 101 | return $user; |
| 98 | 102 | } |
| 99 | 103 | |
| 104 | + /** |
|
| 105 | + * @param string $gid |
|
| 106 | + */ |
|
| 100 | 107 | protected function getGroupMock($gid) { |
| 101 | 108 | $group = $this->getMockBuilder('OCP\IGroup') |
| 102 | 109 | ->disableOriginalConstructor() |
@@ -24,7 +24,6 @@ |
||
| 24 | 24 | |
| 25 | 25 | use OC\Files\Filesystem; |
| 26 | 26 | use OC\Files\View; |
| 27 | -use OC\Lock\MemcacheLockingProvider; |
|
| 28 | 27 | use OCP\Lock\ILockingProvider; |
| 29 | 28 | |
| 30 | 29 | class Locking extends TestCase { |
@@ -218,6 +218,10 @@ |
||
| 218 | 218 | |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | + /** |
|
| 222 | + * @param OC\Files\FileInfo[] $content |
|
| 223 | + * @param string[] $expected |
|
| 224 | + */ |
|
| 221 | 225 | public function verifyDirContent($content, $expected) { |
| 222 | 226 | foreach ($content as $c) { |
| 223 | 227 | if (!in_array($c['name'], $expected)) { |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | * |
| 148 | 148 | * @param string $sourcePath |
| 149 | 149 | * @param string $owner |
| 150 | - * @param $targetPath |
|
| 150 | + * @param string $targetPath |
|
| 151 | 151 | * @param $user |
| 152 | 152 | * @param integer $timestamp |
| 153 | 153 | */ |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | * @param string $uniqueFilename new file name to restore the file without overwriting existing files |
| 425 | 425 | * @param string $location location if file |
| 426 | 426 | * @param int $timestamp deletion time |
| 427 | - * @return bool |
|
| 427 | + * @return false|null |
|
| 428 | 428 | */ |
| 429 | 429 | private static function restoreVersions(\OC\Files\View $view, $file, $filename, $uniqueFilename, $location, $timestamp) { |
| 430 | 430 | |
@@ -514,9 +514,10 @@ discard block |
||
| 514 | 514 | |
| 515 | 515 | /** |
| 516 | 516 | * @param \OC\Files\View $view |
| 517 | - * @param $file |
|
| 518 | - * @param $filename |
|
| 519 | - * @param $timestamp |
|
| 517 | + * @param string $file |
|
| 518 | + * @param string $filename |
|
| 519 | + * @param integer|null $timestamp |
|
| 520 | + * @param string $user |
|
| 520 | 521 | * @return int |
| 521 | 522 | */ |
| 522 | 523 | private static function deleteVersions(\OC\Files\View $view, $file, $filename, $timestamp, $user) { |
@@ -700,7 +701,7 @@ discard block |
||
| 700 | 701 | * |
| 701 | 702 | * @param array $files list of files sorted by mtime |
| 702 | 703 | * @param string $user |
| 703 | - * @return array size of deleted files and number of deleted files |
|
| 704 | + * @return integer[] size of deleted files and number of deleted files |
|
| 704 | 705 | */ |
| 705 | 706 | public static function deleteExpiredFiles($files, $user) { |
| 706 | 707 | $application = new Application(); |
@@ -246,8 +246,8 @@ discard block |
||
| 246 | 246 | |
| 247 | 247 | /** |
| 248 | 248 | * verify that the array contains the expected results |
| 249 | - * @param array $result |
|
| 250 | - * @param array $expected |
|
| 249 | + * @param OCP\Files\FileInfo[] $result |
|
| 250 | + * @param string[] $expected |
|
| 251 | 251 | */ |
| 252 | 252 | private function verifyArray($result, $expected) { |
| 253 | 253 | $this->assertSame(count($expected), count($result)); |
@@ -266,6 +266,11 @@ discard block |
||
| 266 | 266 | } |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | + /** |
|
| 270 | + * @param OCP\Files\FileInfo[] $files |
|
| 271 | + * @param string $trashRoot |
|
| 272 | + * @param integer $expireDate |
|
| 273 | + */ |
|
| 269 | 274 | private function manipulateDeleteTime($files, $trashRoot, $expireDate) { |
| 270 | 275 | $counter = 0; |
| 271 | 276 | foreach ($files as &$file) { |
@@ -625,7 +630,6 @@ discard block |
||
| 625 | 630 | /** |
| 626 | 631 | * @param string $user |
| 627 | 632 | * @param bool $create |
| 628 | - * @param bool $password |
|
| 629 | 633 | */ |
| 630 | 634 | public static function loginHelper($user, $create = false) { |
| 631 | 635 | if ($create) { |
@@ -648,11 +652,20 @@ discard block |
||
| 648 | 652 | |
| 649 | 653 | // just a dummy class to make protected methods available for testing |
| 650 | 654 | class TrashbinForTesting extends Files_Trashbin\Trashbin { |
| 655 | + |
|
| 656 | + /** |
|
| 657 | + * @param OCP\Files\FileInfo[] $files |
|
| 658 | + * @param integer $limit |
|
| 659 | + */ |
|
| 651 | 660 | public function dummyDeleteExpiredFiles($files, $limit) { |
| 652 | 661 | // dummy value for $retention_obligation because it is not needed here |
| 653 | 662 | return parent::deleteExpiredFiles($files, \Test_Trashbin::TEST_TRASHBIN_USER1, $limit, 0); |
| 654 | 663 | } |
| 655 | 664 | |
| 665 | + /** |
|
| 666 | + * @param OCP\Files\FileInfo[] $files |
|
| 667 | + * @param integer $availableSpace |
|
| 668 | + */ |
|
| 656 | 669 | public function dummyDeleteFiles($files, $availableSpace) { |
| 657 | 670 | return parent::deleteFiles($files, \Test_Trashbin::TEST_TRASHBIN_USER1, $availableSpace); |
| 658 | 671 | } |