diff options
Diffstat (limited to 'build')
-rw-r--r-- | build/integration/features/bootstrap/CapabilitiesContext.php | 2 | ||||
-rw-r--r-- | build/integration/features/bootstrap/CommandLineContext.php | 8 | ||||
-rw-r--r-- | build/integration/features/bootstrap/FakeSMTPHelper.php | 8 | ||||
-rw-r--r-- | build/integration/features/bootstrap/Provisioning.php | 4 | ||||
-rw-r--r-- | build/integration/features/transfer-ownership.feature | 97 | ||||
-rw-r--r-- | build/license.php | 2 | ||||
-rw-r--r-- | build/package-lock.json | 6 | ||||
-rw-r--r-- | build/package.json | 2 | ||||
-rw-r--r-- | build/psalm-baseline.xml | 31 |
9 files changed, 117 insertions, 43 deletions
diff --git a/build/integration/features/bootstrap/CapabilitiesContext.php b/build/integration/features/bootstrap/CapabilitiesContext.php index 19da7bc62c1..bba85e3c65e 100644 --- a/build/integration/features/bootstrap/CapabilitiesContext.php +++ b/build/integration/features/bootstrap/CapabilitiesContext.php @@ -53,7 +53,7 @@ class CapabilitiesContext implements Context, SnippetAcceptingContext { } $answeredValue = (string)$answeredValue; Assert::assertEquals( - $row['value']==="EMPTY" ? '' : $row['value'], + $row['value'] === "EMPTY" ? '' : $row['value'], $answeredValue, "Failed field " . $row['capability'] . " " . $row['path_to_element'] ); diff --git a/build/integration/features/bootstrap/CommandLineContext.php b/build/integration/features/bootstrap/CommandLineContext.php index 3acb59ec404..6db8de6b485 100644 --- a/build/integration/features/bootstrap/CommandLineContext.php +++ b/build/integration/features/bootstrap/CommandLineContext.php @@ -27,6 +27,7 @@ require __DIR__ . '/../../vendor/autoload.php'; use Behat\Behat\Hook\Scope\BeforeScenarioScope; +use PHPUnit\Framework\Assert; class CommandLineContext implements \Behat\Behat\Context\Context { use CommandLine; @@ -129,4 +130,11 @@ class CommandLineContext implements \Behat\Behat\Context\Context { $davPath = rtrim($davPath, '/') . $this->lastTransferPath; $this->featureContext->usingDavPath($davPath); } + + /** + * @Then /^transfer folder name contains "([^"]+)"$/ + */ + public function transferFolderNameContains($text) { + Assert::assertContains($text, $this->lastTransferPath); + } } diff --git a/build/integration/features/bootstrap/FakeSMTPHelper.php b/build/integration/features/bootstrap/FakeSMTPHelper.php index d8f6be4dc23..1cc1a5fe7a7 100644 --- a/build/integration/features/bootstrap/FakeSMTPHelper.php +++ b/build/integration/features/bootstrap/FakeSMTPHelper.php @@ -113,7 +113,7 @@ class fakeSMTP { $this->mail['emailBody'] = $splitmail[1]; $headers = preg_replace("/ \s+/", ' ', preg_replace("/\n\s/", ' ', $this->mail['emailHeaders'])); $headerlines = explode("\n", $headers); - for ($i=0; $i<count($headerlines); $i++) { + for ($i = 0; $i < count($headerlines); $i++) { if (preg_match('/^Subject: (.*)/i', $headerlines[$i], $matches)) { $this->mail['emailSubject'] = trim($matches[1]); } @@ -152,13 +152,13 @@ class fakeSMTP { return preg_match('/^[_a-z0-9-+]+(\.[_a-z0-9-+]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/', strtolower($email)); } - private function generateRandom($length=8) { + private function generateRandom($length = 8) { $password = ''; $possible = '2346789BCDFGHJKLMNPQRTVWXYZ'; $maxlength = strlen($possible); $i = 0; - for ($i=0; $i < $length; $i++) { - $char = substr($possible, mt_rand(0, $maxlength-1), 1); + for ($i = 0; $i < $length; $i++) { + $char = substr($possible, mt_rand(0, $maxlength - 1), 1); if (!strstr($password, $char)) { $password .= $char; } diff --git a/build/integration/features/bootstrap/Provisioning.php b/build/integration/features/bootstrap/Provisioning.php index daf5b11569c..56d75c058aa 100644 --- a/build/integration/features/bootstrap/Provisioning.php +++ b/build/integration/features/bootstrap/Provisioning.php @@ -70,7 +70,7 @@ trait Provisioning { } /** - * @Given /^user "([^"]*)" with displayname "([^"]*)" exists$/ + * @Given /^user "([^"]*)" with displayname "((?:[^"]|\\")*)" exists$/ * @param string $user */ public function assureUserWithDisplaynameExists($user, $displayname) { @@ -422,7 +422,7 @@ trait Provisioning { 'groupid' => $group, ]; - $this->response =$client->post($fullUrl, $options); + $this->response = $client->post($fullUrl, $options); } diff --git a/build/integration/features/transfer-ownership.feature b/build/integration/features/transfer-ownership.feature index 76e55af89a7..d8dd4d5c09d 100644 --- a/build/integration/features/transfer-ownership.feature +++ b/build/integration/features/transfer-ownership.feature @@ -29,6 +29,22 @@ Feature: transfer-ownership And using received transfer folder of "user1" as dav path And as "user1" the folder "/test" exists + Scenario: transferring ownership from user with risky display name + Given user "user0" with displayname "user0 \"risky\"? ヂspḷay 'na|\/|e':.#" exists + And user "user1" exists + And User "user0" created a folder "/test" + And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt" + When transferring ownership from "user0" to "user1" + And the command was successful + And As an "user1" + And using received transfer folder of "user1" as dav path + Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is" + And transfer folder name contains "transferred from user0 -risky- ヂspḷay -na|-|e- on" + And using old dav path + And as "user0" the folder "/test" does not exist + And using received transfer folder of "user1" as dav path + And as "user1" the folder "/test" exists + Scenario: transferring ownership of file shares Given user "user0" exists And user "user1" exists @@ -290,6 +306,20 @@ Feature: transfer-ownership Then the command error output contains the text "Unknown target user" And the command failed with exit code 1 + Scenario: transferring ownership of a file + Given user "user0" exists + And user "user1" exists + And User "user0" uploads file "data/textfile.txt" to "/somefile.txt" + When transferring ownership of path "somefile.txt" from "user0" to "user1" + And the command was successful + And As an "user1" + And using received transfer folder of "user1" as dav path + Then Downloaded content when downloading file "/somefile.txt" with range "bytes=0-6" should be "This is" + And using old dav path + And as "user0" the file "/somefile.txt" does not exist + And using received transfer folder of "user1" as dav path + And as "user1" the file "/somefile.txt" exists + Scenario: transferring ownership of a folder Given user "user0" exists And user "user1" exists @@ -305,6 +335,73 @@ Feature: transfer-ownership And using received transfer folder of "user1" as dav path And as "user1" the folder "/test" exists + Scenario: transferring ownership from user with risky display name + Given user "user0" with displayname "user0 \"risky\"? ヂspḷay 'na|\/|e':.#" exists + And user "user1" exists + And User "user0" created a folder "/test" + And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt" + When transferring ownership of path "test" from "user0" to "user1" + And the command was successful + And As an "user1" + And using received transfer folder of "user1" as dav path + Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is" + And transfer folder name contains "transferred from user0 -risky- ヂspḷay -na|-|e- on" + And using old dav path + And as "user0" the folder "/test" does not exist + And using received transfer folder of "user1" as dav path + And as "user1" the folder "/test" exists + + Scenario: transferring ownership of path does not affect other files + Given user "user0" exists + And user "user1" exists + And User "user0" created a folder "/test" + And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt" + And User "user0" created a folder "/test2" + And User "user0" uploads file "data/textfile.txt" to "/test2/somefile.txt" + When transferring ownership of path "test" from "user0" to "user1" + And the command was successful + And As an "user1" + And using received transfer folder of "user1" as dav path + Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is" + And using old dav path + And as "user0" the folder "/test" does not exist + And as "user0" the folder "/test2" exists + And as "user0" the file "/test2/somefile.txt" exists + And using received transfer folder of "user1" as dav path + And as "user1" the folder "/test" exists + And as "user1" the folder "/test2" does not exist + + Scenario: transferring ownership of path does not affect other shares + Given user "user0" exists + And user "user1" exists + And User "user0" created a folder "/test" + And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt" + And User "user0" created a folder "/test2" + And User "user0" uploads file "data/textfile.txt" to "/test2/sharedfile.txt" + And file "/test2/sharedfile.txt" of user "user0" is shared with user "user1" with permissions 19 + And user "user1" accepts last share + When transferring ownership of path "test" from "user0" to "user1" + And the command was successful + And As an "user1" + And using received transfer folder of "user1" as dav path + Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is" + And using old dav path + And as "user0" the folder "/test" does not exist + And as "user0" the folder "/test2" exists + And as "user0" the file "/test2/sharedfile.txt" exists + And using received transfer folder of "user1" as dav path + And as "user1" the folder "/test" exists + And as "user1" the folder "/test2" does not exist + And using old dav path + And as "user1" the file "/sharedfile.txt" exists + And As an "user1" + And Getting info of last share + And the OCS status code should be "100" + And Share fields of last share match with + | uid_owner | user0 | + | uid_file_owner | user0 | + | share_with | user1 | + Scenario: transferring ownership of file shares Given user "user0" exists And user "user1" exists diff --git a/build/license.php b/build/license.php index 7bd9e1054c0..e736419e2ac 100644 --- a/build/license.php +++ b/build/license.php @@ -287,7 +287,7 @@ With help from many libraries and frameworks including: chdir($buildDir); } $timestampChanges = explode(PHP_EOL, $out); - $timestampChanges = array_slice($timestampChanges, 0, count($timestampChanges)-1); + $timestampChanges = array_slice($timestampChanges, 0, count($timestampChanges) - 1); foreach ($timestampChanges as $timestamp) { if ((int)$timestamp < $deadlineTimestamp) { return; diff --git a/build/package-lock.json b/build/package-lock.json index 5e9ba07ae73..a6d9264d301 100644 --- a/build/package-lock.json +++ b/build/package-lock.json @@ -3064,9 +3064,9 @@ "dev": true }, "jsdoc": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.5.tgz", - "integrity": "sha512-SbY+i9ONuxSK35cgVHaI8O9senTE4CDYAmGSDJ5l3+sfe62Ff4gy96osy6OW84t4K4A8iGnMrlRrsSItSNp3RQ==", + "version": "3.6.6", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.6.tgz", + "integrity": "sha512-znR99e1BHeyEkSvgDDpX0sTiTu+8aQyDl9DawrkOGZTTW8hv0deIFXx87114zJ7gRaDZKVQD/4tr1ifmJp9xhQ==", "dev": true, "requires": { "@babel/parser": "^7.9.4", diff --git a/build/package.json b/build/package.json index 76f1035752e..a19da6842e0 100644 --- a/build/package.json +++ b/build/package.json @@ -14,7 +14,7 @@ "handlebars": "^4.7.6", "jasmine-core": "~2.5.2", "jasmine-sinon": "^0.4.0", - "jsdoc": "^3.6.5", + "jsdoc": "^3.6.6", "karma": "^3.1.4", "karma-coverage": "2.0.1", "karma-jasmine": "^1.1.2", diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index cd1dd96cad1..e962e6b0e76 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -50,13 +50,6 @@ <code>$this->appRoot</code> </UndefinedThisPropertyFetch> </file> - <file src="apps/admin_audit/lib/AppInfo/Application.php"> - <UndefinedInterfaceMethod occurrences="3"> - <code>listen</code> - <code>listen</code> - <code>listen</code> - </UndefinedInterfaceMethod> - </file> <file src="apps/cloud_federation_api/lib/Controller/RequestHandlerController.php"> <InvalidScalarArgument occurrences="1"> <code>$e->getCode()</code> @@ -2154,11 +2147,6 @@ <code>ignoreNextcloudRequirementForApp</code> </UndefinedInterfaceMethod> </file> - <file src="apps/settings/lib/Controller/ChangePasswordController.php"> - <UndefinedInterfaceMethod occurrences="1"> - <code>getSubAdmin</code> - </UndefinedInterfaceMethod> - </file> <file src="apps/settings/lib/Controller/CheckSetupController.php"> <InvalidArgument occurrences="2"> <code>IDBConnection::CHECK_MISSING_INDEXES_EVENT</code> @@ -2190,13 +2178,6 @@ <code>$this->l10n->t('You need to set your user email before being able to send test emails.')</code> </InvalidArgument> </file> - <file src="apps/settings/lib/Controller/UsersController.php"> - <UndefinedInterfaceMethod occurrences="3"> - <code>countUsersOfGroups</code> - <code>countDisabledUsersOfGroups</code> - <code>getLanguages</code> - </UndefinedInterfaceMethod> - </file> <file src="apps/settings/lib/Hooks.php"> <InvalidArgument occurrences="1"> <code>[$user->getEMailAddress() => $user->getDisplayName()]</code> @@ -2311,14 +2292,6 @@ <code>$iconFile !== false</code> </RedundantCondition> </file> - <file src="apps/theming/lib/Controller/ThemingController.php"> - <InvalidScalarArgument occurrences="4"> - <code>'r'</code> - <code>$newHeight</code> - <code>'r'</code> - <code>'r'</code> - </InvalidScalarArgument> - </file> <file src="apps/theming/lib/IconBuilder.php"> <InvalidScalarArgument occurrences="2"> <code>$offset_w</code> @@ -4901,7 +4874,6 @@ <code>$result && in_array('delete', $hooks) and $result</code> </RedundantCondition> <UndefinedDocblockClass occurrences="2"> - <code>list($storage, $internalPath)</code> <code>$storage</code> </UndefinedDocblockClass> <UndefinedInterfaceMethod occurrences="20"> @@ -5003,9 +4975,6 @@ <code>$sortMode</code> <code>self::SORT_NONE</code> </InvalidPropertyAssignmentValue> - <UndefinedInterfaceMethod occurrences="1"> - <code>getSubAdmin</code> - </UndefinedInterfaceMethod> </file> <file src="lib/private/Http/Client/Response.php"> <InvalidNullableReturnType occurrences="1"> |