summaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/appinfo/v1/caldav.php4
-rw-r--r--apps/dav/appinfo/v1/carddav.php4
-rw-r--r--apps/dav/appinfo/v1/publicwebdav.php2
-rw-r--r--apps/dav/lib/CalDAV/CalDavBackend.php2
-rw-r--r--apps/dav/lib/CalDAV/Schedule/IMipPlugin.php4
-rw-r--r--apps/dav/lib/CardDAV/CardDavBackend.php6
-rw-r--r--apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/Directory.php8
-rw-r--r--apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/File.php24
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesPlugin.php10
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesReportPlugin.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/MaintenancePlugin.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/Node.php6
-rw-r--r--apps/dav/lib/Connector/Sabre/SharesPlugin.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/TagsPlugin.php14
-rw-r--r--apps/dav/lib/Files/BrowserErrorPagePlugin.php2
-rw-r--r--apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php2
-rw-r--r--apps/dav/lib/SystemTag/SystemTagPlugin.php4
-rw-r--r--apps/dav/tests/unit/CalDAV/CalDavBackendTest.php2
-rw-r--r--apps/dav/tests/unit/CalDAV/CalendarTest.php2
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php30
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php2
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/FileTest.php52
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php26
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/NodeTest.php28
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php36
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php2
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php86
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php128
-rw-r--r--apps/dav/tests/unit/DAV/GroupPrincipalTest.php2
-rw-r--r--apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php8
33 files changed, 254 insertions, 254 deletions
diff --git a/apps/dav/appinfo/v1/caldav.php b/apps/dav/appinfo/v1/caldav.php
index 529fa576b4a..82fddd152e6 100644
--- a/apps/dav/appinfo/v1/caldav.php
+++ b/apps/dav/appinfo/v1/caldav.php
@@ -69,10 +69,10 @@ $principalCollection->disableListing = !$debugging; // Disable listing
$addressBookRoot = new CalendarRoot($principalBackend, $calDavBackend);
$addressBookRoot->disableListing = !$debugging; // Disable listing
-$nodes = array(
+$nodes = [
$principalCollection,
$addressBookRoot,
-);
+];
// Fire up server
$server = new \Sabre\DAV\Server($nodes);
diff --git a/apps/dav/appinfo/v1/carddav.php b/apps/dav/appinfo/v1/carddav.php
index b8886c0d152..b2e812c2c18 100644
--- a/apps/dav/appinfo/v1/carddav.php
+++ b/apps/dav/appinfo/v1/carddav.php
@@ -69,10 +69,10 @@ $pluginManager = new PluginManager(\OC::$server, \OC::$server->query(IAppManager
$addressBookRoot = new AddressBookRoot($principalBackend, $cardDavBackend, $pluginManager);
$addressBookRoot->disableListing = !$debugging; // Disable listing
-$nodes = array(
+$nodes = [
$principalCollection,
$addressBookRoot,
-);
+];
// Fire up server
$server = new \Sabre\DAV\Server($nodes);
diff --git a/apps/dav/appinfo/v1/publicwebdav.php b/apps/dav/appinfo/v1/publicwebdav.php
index f0e3cc6438d..53f1b0d62b4 100644
--- a/apps/dav/appinfo/v1/publicwebdav.php
+++ b/apps/dav/appinfo/v1/publicwebdav.php
@@ -79,7 +79,7 @@ $server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, funct
// FIXME: should not add storage wrappers outside of preSetup, need to find a better way
$previousLog = \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false);
\OC\Files\Filesystem::addStorageWrapper('sharePermissions', function ($mountPoint, $storage) use ($share) {
- return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => $share->getPermissions() | \OCP\Constants::PERMISSION_SHARE));
+ return new \OC\Files\Storage\Wrapper\PermissionsMask(['storage' => $storage, 'mask' => $share->getPermissions() | \OCP\Constants::PERMISSION_SHARE]);
});
\OC\Files\Filesystem::logWarningWhenAddingStorageWrapper($previousLog);
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php
index 96459566a5a..7280288c02d 100644
--- a/apps/dav/lib/CalDAV/CalDavBackend.php
+++ b/apps/dav/lib/CalDAV/CalDavBackend.php
@@ -1944,7 +1944,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
}
}
- $valuesToInsert = array();
+ $valuesToInsert = [];
$query = $this->db->getQueryBuilder();
diff --git a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
index 982c579d3bb..3b66e84fc2b 100644
--- a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
+++ b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
@@ -237,13 +237,13 @@ class IMipPlugin extends SabreIMipPlugin {
break;
}
- $data = array(
+ $data = [
'attendee_name' => (string)$meetingAttendeeName ?: $defaultVal,
'invitee_name' => (string)$meetingInviteeName ?: $defaultVal,
'meeting_title' => (string)$meetingTitle ?: $defaultVal,
'meeting_description' => (string)$meetingDescription ?: $defaultVal,
'meeting_url' => (string)$meetingUrl ?: $defaultVal,
- );
+ ];
$fromEMail = \OCP\Util::getDefaultEmailAddress('invitations-noreply');
$fromName = $l10n->t('%1$s via %2$s', [$senderName, $this->defaults->getName()]);
diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php
index 24b91f7cec3..bd89b233aee 100644
--- a/apps/dav/lib/CardDAV/CardDavBackend.php
+++ b/apps/dav/lib/CardDAV/CardDavBackend.php
@@ -74,9 +74,9 @@ class CardDavBackend implements BackendInterface, SyncSupport {
private $sharingBackend;
/** @var array properties to index */
- public static $indexProperties = array(
+ public static $indexProperties = [
'BDAY', 'UID', 'N', 'FN', 'TITLE', 'ROLE', 'NOTE', 'NICKNAME',
- 'ORG', 'CATEGORIES', 'EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'GEO', 'CLOUD');
+ 'ORG', 'CATEGORIES', 'EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'GEO', 'CLOUD'];
/**
* @var string[] Map of uid => display name
@@ -909,7 +909,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
* - 'escape_like_param' - If set to false wildcards _ and % are not escaped, otherwise they are
* @return array an array of contacts which are arrays of key-value-pairs
*/
- public function search($addressBookId, $pattern, $searchProperties, $options = array()) {
+ public function search($addressBookId, $pattern, $searchProperties, $options = []) {
$query = $this->db->getQueryBuilder();
$query2 = $this->db->getQueryBuilder();
diff --git a/apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php b/apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php
index 139044f9535..947b2960eab 100644
--- a/apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php
@@ -74,7 +74,7 @@ class AppEnabledPlugin extends ServerPlugin {
public function initialize(\Sabre\DAV\Server $server) {
$this->server = $server;
- $this->server->on('beforeMethod', array($this, 'checkAppEnabled'), 30);
+ $this->server->on('beforeMethod', [$this, 'checkAppEnabled'], 30);
}
/**
diff --git a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php
index 1a069e548b4..22f0104940d 100644
--- a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php
@@ -67,7 +67,7 @@ class CommentPropertiesPlugin extends ServerPlugin {
*/
function initialize(\Sabre\DAV\Server $server) {
$this->server = $server;
- $this->server->on('propFind', array($this, 'handleGetProperties'));
+ $this->server->on('propFind', [$this, 'handleGetProperties']);
}
/**
diff --git a/apps/dav/lib/Connector/Sabre/Directory.php b/apps/dav/lib/Connector/Sabre/Directory.php
index d17cfb81777..9b44997fb60 100644
--- a/apps/dav/lib/Connector/Sabre/Directory.php
+++ b/apps/dav/lib/Connector/Sabre/Directory.php
@@ -267,7 +267,7 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node
throw new Locked();
}
- $nodes = array();
+ $nodes = [];
foreach ($folderContent as $info) {
$node = $this->getChild($info->getName(), $info);
$nodes[] = $node;
@@ -336,13 +336,13 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node
} else {
$free = $storageInfo['free'];
}
- $this->quotaInfo = array(
+ $this->quotaInfo = [
$storageInfo['used'],
$free
- );
+ ];
return $this->quotaInfo;
} catch (\OCP\Files\StorageNotAvailableException $e) {
- return array(0, 0);
+ return [0, 0];
}
}
diff --git a/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php b/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php
index dc595197965..cf617152eb8 100644
--- a/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php
@@ -103,7 +103,7 @@ class ExceptionLoggerPlugin extends \Sabre\DAV\ServerPlugin {
*/
public function initialize(\Sabre\DAV\Server $server) {
- $server->on('exception', array($this, 'logException'), 10);
+ $server->on('exception', [$this, 'logException'], 10);
}
/**
diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php
index 098961ce130..0bd01de408b 100644
--- a/apps/dav/lib/Connector/Sabre/File.php
+++ b/apps/dav/lib/Connector/Sabre/File.php
@@ -359,20 +359,20 @@ class File extends Node implements IFile {
$run = true;
if (!$exists) {
- \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_create, array(
+ \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_create, [
\OC\Files\Filesystem::signal_param_path => $hookPath,
\OC\Files\Filesystem::signal_param_run => &$run,
- ));
+ ]);
} else {
- \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_update, array(
+ \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_update, [
\OC\Files\Filesystem::signal_param_path => $hookPath,
\OC\Files\Filesystem::signal_param_run => &$run,
- ));
+ ]);
}
- \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_write, array(
+ \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_write, [
\OC\Files\Filesystem::signal_param_path => $hookPath,
\OC\Files\Filesystem::signal_param_run => &$run,
- ));
+ ]);
return $run;
}
@@ -385,17 +385,17 @@ class File extends Node implements IFile {
}
$hookPath = Filesystem::getView()->getRelativePath($this->fileView->getAbsolutePath($path));
if (!$exists) {
- \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_create, array(
+ \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_create, [
\OC\Files\Filesystem::signal_param_path => $hookPath
- ));
+ ]);
} else {
- \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_update, array(
+ \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_update, [
\OC\Files\Filesystem::signal_param_path => $hookPath
- ));
+ ]);
}
- \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_write, array(
+ \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_write, [
\OC\Files\Filesystem::signal_param_path => $hookPath
- ));
+ ]);
}
/**
diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
index 498058f7c03..a35db1e77e4 100644
--- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
@@ -173,12 +173,12 @@ class FilesPlugin extends ServerPlugin {
$server->protectedProperties = array_diff($server->protectedProperties, $allowedProperties);
$this->server = $server;
- $this->server->on('propFind', array($this, 'handleGetProperties'));
- $this->server->on('propPatch', array($this, 'handleUpdateProperties'));
- $this->server->on('afterBind', array($this, 'sendFileIdHeader'));
- $this->server->on('afterWriteContent', array($this, 'sendFileIdHeader'));
+ $this->server->on('propFind', [$this, 'handleGetProperties']);
+ $this->server->on('propPatch', [$this, 'handleUpdateProperties']);
+ $this->server->on('afterBind', [$this, 'sendFileIdHeader']);
+ $this->server->on('afterWriteContent', [$this, 'sendFileIdHeader']);
$this->server->on('afterMethod:GET', [$this,'httpGet']);
- $this->server->on('afterMethod:GET', array($this, 'handleDownloadToken'));
+ $this->server->on('afterMethod:GET', [$this, 'handleDownloadToken']);
$this->server->on('afterResponse', function($request, ResponseInterface $response) {
$body = $response->getBody();
if (is_resource($body)) {
diff --git a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
index 41de6ea4ed8..a2de82fa9c5 100644
--- a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
@@ -154,7 +154,7 @@ class FilesReportPlugin extends ServerPlugin {
$server->xml->namespaceMap[self::NS_OWNCLOUD] = 'oc';
$this->server = $server;
- $this->server->on('report', array($this, 'onReport'));
+ $this->server->on('report', [$this, 'onReport']);
}
/**
diff --git a/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php b/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php
index d015bcbc21c..4076abe59fe 100644
--- a/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php
+++ b/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php
@@ -67,7 +67,7 @@ class MaintenancePlugin extends ServerPlugin {
*/
public function initialize(\Sabre\DAV\Server $server) {
$this->server = $server;
- $this->server->on('beforeMethod', array($this, 'checkMaintenanceMode'), 1);
+ $this->server->on('beforeMethod', [$this, 'checkMaintenanceMode'], 1);
}
/**
diff --git a/apps/dav/lib/Connector/Sabre/Node.php b/apps/dav/lib/Connector/Sabre/Node.php
index f178b2fbfbd..5f9ecf88142 100644
--- a/apps/dav/lib/Connector/Sabre/Node.php
+++ b/apps/dav/lib/Connector/Sabre/Node.php
@@ -200,15 +200,15 @@ abstract class Node implements \Sabre\DAV\INode {
* @return int file id of updated file or -1 on failure
*/
public function setETag($etag) {
- return $this->fileView->putFileInfo($this->path, array('etag' => $etag));
+ return $this->fileView->putFileInfo($this->path, ['etag' => $etag]);
}
public function setCreationTime(int $time) {
- return $this->fileView->putFileInfo($this->path, array('creation_time' => $time));
+ return $this->fileView->putFileInfo($this->path, ['creation_time' => $time]);
}
public function setUploadTime(int $time) {
- return $this->fileView->putFileInfo($this->path, array('upload_time' => $time));
+ return $this->fileView->putFileInfo($this->path, ['upload_time' => $time]);
}
/**
diff --git a/apps/dav/lib/Connector/Sabre/SharesPlugin.php b/apps/dav/lib/Connector/Sabre/SharesPlugin.php
index a4baa65948e..9d543e55a4b 100644
--- a/apps/dav/lib/Connector/Sabre/SharesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/SharesPlugin.php
@@ -107,7 +107,7 @@ class SharesPlugin extends \Sabre\DAV\ServerPlugin {
$server->protectedProperties[] = self::SHAREES_PROPERTYNAME;
$this->server = $server;
- $this->server->on('propFind', array($this, 'handleGetProperties'));
+ $this->server->on('propFind', [$this, 'handleGetProperties']);
}
private function getShare(\OCP\Files\Node $node): array {
diff --git a/apps/dav/lib/Connector/Sabre/TagsPlugin.php b/apps/dav/lib/Connector/Sabre/TagsPlugin.php
index fe19b434648..2ac7c01f426 100644
--- a/apps/dav/lib/Connector/Sabre/TagsPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/TagsPlugin.php
@@ -98,7 +98,7 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin
$this->tree = $tree;
$this->tagManager = $tagManager;
$this->tagger = null;
- $this->cachedTags = array();
+ $this->cachedTags = [];
}
/**
@@ -118,8 +118,8 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin
$server->xml->elementMap[self::TAGS_PROPERTYNAME] = TagList::class;
$this->server = $server;
- $this->server->on('propFind', array($this, 'handleGetProperties'));
- $this->server->on('propPatch', array($this, 'handleUpdateProperties'));
+ $this->server->on('propFind', [$this, 'handleGetProperties']);
+ $this->server->on('propPatch', [$this, 'handleUpdateProperties']);
}
/**
@@ -151,7 +151,7 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin
unset($tags[$favPos]);
}
}
- return array($tags, $isFav);
+ return [$tags, $isFav];
}
/**
@@ -164,10 +164,10 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin
if (isset($this->cachedTags[$fileId])) {
return $this->cachedTags[$fileId];
} else {
- $tags = $this->getTagger()->getTagsForObjects(array($fileId));
+ $tags = $this->getTagger()->getTagsForObjects([$fileId]);
if ($tags !== false) {
if (empty($tags)) {
- return array();
+ return [];
}
return current($tags);
}
@@ -232,7 +232,7 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin
$tags = $this->getTagger()->getTagsForObjects($fileIds);
if ($tags === false) {
// the tags API returns false on error...
- $tags = array();
+ $tags = [];
}
$this->cachedTags = $this->cachedTags + $tags;
diff --git a/apps/dav/lib/Files/BrowserErrorPagePlugin.php b/apps/dav/lib/Files/BrowserErrorPagePlugin.php
index 9bc169601af..7b0d39f2fbb 100644
--- a/apps/dav/lib/Files/BrowserErrorPagePlugin.php
+++ b/apps/dav/lib/Files/BrowserErrorPagePlugin.php
@@ -48,7 +48,7 @@ class BrowserErrorPagePlugin extends ServerPlugin {
*/
function initialize(Server $server) {
$this->server = $server;
- $server->on('exception', array($this, 'logException'), 1000);
+ $server->on('exception', [$this, 'logException'], 1000);
}
/**
diff --git a/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php b/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php
index b940fa55b5b..f580b7fe47a 100644
--- a/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php
+++ b/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php
@@ -88,7 +88,7 @@ class RemoveOrphanEventsAndContacts implements IRepairStep {
$result = $qb->execute();
- $orphanItems = array();
+ $orphanItems = [];
while ($row = $result->fetch()) {
$orphanItems[] = (int) $row['id'];
}
diff --git a/apps/dav/lib/SystemTag/SystemTagPlugin.php b/apps/dav/lib/SystemTag/SystemTagPlugin.php
index c86f621a67d..d44b21b24c9 100644
--- a/apps/dav/lib/SystemTag/SystemTagPlugin.php
+++ b/apps/dav/lib/SystemTag/SystemTagPlugin.php
@@ -107,8 +107,8 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin {
$server->protectedProperties[] = self::ID_PROPERTYNAME;
- $server->on('propFind', array($this, 'handleGetProperties'));
- $server->on('propPatch', array($this, 'handleUpdateProperties'));
+ $server->on('propFind', [$this, 'handleGetProperties']);
+ $server->on('propPatch', [$this, 'handleUpdateProperties']);
$server->on('method:POST', [$this, 'httpPost']);
$this->server = $server;
diff --git a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
index 257c6665dfe..cc942b5662c 100644
--- a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
@@ -130,7 +130,7 @@ class CalDavBackendTest extends AbstractCalDavBackend {
$l10n
->expects($this->any())
->method('t')
- ->willReturnCallback(function ($text, $parameters = array()) {
+ ->willReturnCallback(function ($text, $parameters = []) {
return vsprintf($text, $parameters);
});
diff --git a/apps/dav/tests/unit/CalDAV/CalendarTest.php b/apps/dav/tests/unit/CalDAV/CalendarTest.php
index 9a9f36c9309..42cbeb1c0b9 100644
--- a/apps/dav/tests/unit/CalDAV/CalendarTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalendarTest.php
@@ -53,7 +53,7 @@ class CalendarTest extends TestCase {
$this->l10n
->expects($this->any())
->method('t')
- ->willReturnCallback(function ($text, $parameters = array()) {
+ ->willReturnCallback(function ($text, $parameters = []) {
return vsprintf($text, $parameters);
});
}
diff --git a/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php b/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php
index 5cd4e69b7f5..518c0b9402a 100644
--- a/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php
@@ -97,9 +97,9 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
' WHERE `userid` = ?'
);
$deleteStatement->execute(
- array(
+ [
$this->user->getUID(),
- )
+ ]
);
$deleteStatement->closeCursor();
}
@@ -121,10 +121,10 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
private function applyDefaultProps($path = '/dummypath') {
// properties to set
- $propPatch = new \Sabre\DAV\PropPatch(array(
+ $propPatch = new \Sabre\DAV\PropPatch([
'customprop' => 'value1',
'customprop2' => 'value2',
- ));
+ ]);
$this->plugin->propPatch(
$path,
@@ -146,11 +146,11 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
public function testPropFindMissingFileSoftFail() {
$propFind = new \Sabre\DAV\PropFind(
'/dummypath',
- array(
+ [
'customprop',
'customprop2',
'unsetprop',
- ),
+ ],
0
);
@@ -176,11 +176,11 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
$propFind = new \Sabre\DAV\PropFind(
'/dummypath',
- array(
+ [
'customprop',
'customprop2',
'unsetprop',
- ),
+ ],
0
);
@@ -191,7 +191,7 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
$this->assertEquals('value1', $propFind->get('customprop'));
$this->assertEquals('value2', $propFind->get('customprop2'));
- $this->assertEquals(array('unsetprop'), $propFind->get404Properties());
+ $this->assertEquals(['unsetprop'], $propFind->get404Properties());
}
/**
@@ -201,11 +201,11 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
$this->applyDefaultProps('/dummypath');
$this->applyDefaultProps('/dummypath/test.txt');
- $propNames = array(
+ $propNames = [
'customprop',
'customprop2',
'unsetprop',
- );
+ ];
$propFindRoot = new \Sabre\DAV\PropFind(
'/dummypath',
@@ -234,11 +234,11 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
$this->assertEquals('value1', $propFindRoot->get('customprop'));
$this->assertEquals('value2', $propFindRoot->get('customprop2'));
- $this->assertEquals(array('unsetprop'), $propFindRoot->get404Properties());
+ $this->assertEquals(['unsetprop'], $propFindRoot->get404Properties());
$this->assertEquals('value1', $propFindSub->get('customprop'));
$this->assertEquals('value2', $propFindSub->get('customprop2'));
- $this->assertEquals(array('unsetprop'), $propFindSub->get404Properties());
+ $this->assertEquals(['unsetprop'], $propFindSub->get404Properties());
}
/**
@@ -247,9 +247,9 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
public function testDeleteProperty() {
$this->applyDefaultProps();
- $propPatch = new \Sabre\DAV\PropPatch(array(
+ $propPatch = new \Sabre\DAV\PropPatch([
'customprop' => null,
- ));
+ ]);
$this->plugin->propPatch(
'/dummypath',
diff --git a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
index 1bf0b533966..9ace061fd0e 100644
--- a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
@@ -201,7 +201,7 @@ class DirectoryTest extends \Test\TestCase {
$this->view->expects($this->once())
->method('getDirectoryContent')
->with('')
- ->willReturn(array($info1, $info2));
+ ->willReturn([$info1, $info2]);
$this->view->expects($this->any())
->method('getRelativePath')
diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php
index 96f5a2c385c..a898ba5dee7 100644
--- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php
@@ -202,9 +202,9 @@ class FileTest extends TestCase {
->method('getRelativePath')
->willReturnArgument(0);
- $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
@@ -631,10 +631,10 @@ class FileTest extends TestCase {
}
public static function cancellingHook($params) {
- self::$hookCalls[] = array(
+ self::$hookCalls[] = [
'signal' => Filesystem::signal_post_create,
'params' => $params
- );
+ ];
}
/**
@@ -683,9 +683,9 @@ class FileTest extends TestCase {
$_SERVER['CONTENT_LENGTH'] = 123456;
$_SERVER['REQUEST_METHOD'] = 'PUT';
- $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
@@ -716,9 +716,9 @@ class FileTest extends TestCase {
// simulate situation where the target file is locked
$view->lockFile('/test.txt', ILockingProvider::LOCK_EXCLUSIVE);
- $info = new \OC\Files\FileInfo('/' . $this->user . '/files/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/' . $this->user . '/files/test.txt', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
@@ -790,9 +790,9 @@ class FileTest extends TestCase {
->method('getRelativePath')
->willReturnArgument(0);
- $info = new \OC\Files\FileInfo('/*', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/*', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
// action
@@ -829,9 +829,9 @@ class FileTest extends TestCase {
->method('getRelativePath')
->willReturnArgument(0);
- $info = new \OC\Files\FileInfo('/*', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/*', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
$file->setName('/super*star.txt');
}
@@ -856,9 +856,9 @@ class FileTest extends TestCase {
$_SERVER['CONTENT_LENGTH'] = 12345;
$_SERVER['REQUEST_METHOD'] = 'PUT';
- $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
@@ -890,9 +890,9 @@ class FileTest extends TestCase {
->method('unlink')
->willReturn(true);
- $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
@@ -908,9 +908,9 @@ class FileTest extends TestCase {
$view = $this->getMockBuilder(View::class)
->getMock();
- $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
'permissions' => 0
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
@@ -931,9 +931,9 @@ class FileTest extends TestCase {
->method('unlink')
->willReturn(false);
- $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
@@ -954,9 +954,9 @@ class FileTest extends TestCase {
->method('unlink')
->willThrowException(new ForbiddenException('', true));
- $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
@@ -1122,9 +1122,9 @@ class FileTest extends TestCase {
->method('fopen')
->willReturn(false);
- $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
@@ -1142,9 +1142,9 @@ class FileTest extends TestCase {
->method('fopen')
->willThrowException(new ForbiddenException('', true));
- $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
index d1e863b18ba..06495ccd5e2 100644
--- a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
@@ -181,7 +181,7 @@ class FilesPluginTest extends TestCase {
$propFind = new PropFind(
'/dummyPath',
- array(
+ [
self::GETETAG_PROPERTYNAME,
self::FILEID_PROPERTYNAME,
self::INTERNAL_FILEID_PROPERTYNAME,
@@ -191,7 +191,7 @@ class FilesPluginTest extends TestCase {
self::OWNER_ID_PROPERTYNAME,
self::OWNER_DISPLAY_NAME_PROPERTYNAME,
self::DATA_FINGERPRINT_PROPERTYNAME,
- ),
+ ],
0
);
@@ -208,7 +208,7 @@ class FilesPluginTest extends TestCase {
$node->expects($this->once())
->method('getDirectDownload')
- ->willReturn(array('url' => 'http://example.com/'));
+ ->willReturn(['url' => 'http://example.com/']);
$node->expects($this->exactly(2))
->method('getOwner')
->willReturn($user);
@@ -236,9 +236,9 @@ class FilesPluginTest extends TestCase {
$propFind = new PropFind(
'/dummyPath',
- array(
+ [
self::DOWNLOADURL_PROPERTYNAME,
- ),
+ ],
0
);
@@ -293,14 +293,14 @@ class FilesPluginTest extends TestCase {
$propFind = new PropFind(
'/dummyPath',
- array(
+ [
self::GETETAG_PROPERTYNAME,
self::FILEID_PROPERTYNAME,
self::SIZE_PROPERTYNAME,
self::PERMISSIONS_PROPERTYNAME,
self::DOWNLOADURL_PROPERTYNAME,
self::DATA_FINGERPRINT_PROPERTYNAME,
- ),
+ ],
0
);
@@ -405,10 +405,10 @@ class FilesPluginTest extends TestCase {
->willReturn(true);
// properties to set
- $propPatch = new PropPatch(array(
+ $propPatch = new PropPatch([
self::GETETAG_PROPERTYNAME => 'newetag',
self::LASTMODIFIED_PROPERTYNAME => $testDate
- ));
+ ]);
$this->plugin->handleUpdateProperties(
'/dummypath',
@@ -425,14 +425,14 @@ class FilesPluginTest extends TestCase {
}
public function testUpdatePropsForbidden() {
- $propPatch = new PropPatch(array(
+ $propPatch = new PropPatch([
self::OWNER_ID_PROPERTYNAME => 'user2',
self::OWNER_DISPLAY_NAME_PROPERTYNAME => 'User Two',
self::FILEID_PROPERTYNAME => 12345,
self::PERMISSIONS_PROPERTYNAME => 'C',
self::SIZE_PROPERTYNAME => 123,
self::DOWNLOADURL_PROPERTYNAME => 'http://example.com/',
- ));
+ ]);
$this->plugin->handleUpdateProperties(
'/dummypath',
@@ -588,9 +588,9 @@ class FilesPluginTest extends TestCase {
$propFind = new PropFind(
'/dummyPath',
- array(
+ [
self::HAS_PREVIEW_PROPERTYNAME
- ),
+ ],
0
);
diff --git a/apps/dav/tests/unit/Connector/Sabre/NodeTest.php b/apps/dav/tests/unit/Connector/Sabre/NodeTest.php
index 5d71a705362..93542f80368 100644
--- a/apps/dav/tests/unit/Connector/Sabre/NodeTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/NodeTest.php
@@ -42,19 +42,19 @@ use OCP\Share\IShare;
*/
class NodeTest extends \Test\TestCase {
public function davPermissionsProvider() {
- return array(
- array(\OCP\Constants::PERMISSION_ALL, 'file', false, false, 'RGDNVW'),
- array(\OCP\Constants::PERMISSION_ALL, 'dir', false, false, 'RGDNVCK'),
- array(\OCP\Constants::PERMISSION_ALL, 'file', true, false, 'SRGDNVW'),
- array(\OCP\Constants::PERMISSION_ALL, 'file', true, true, 'SRMGDNVW'),
- array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_SHARE, 'file', true, false, 'SGDNVW'),
- array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_UPDATE, 'file', false, false, 'RGD'),
- array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_DELETE, 'file', false, false, 'RGNVW'),
- array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE, 'file', false, false, 'RGDNVW'),
- array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_READ, 'file', false, false, 'RDNVW'),
- array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE, 'dir', false, false, 'RGDNV'),
- array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_READ, 'dir', false, false, 'RDNVCK'),
- );
+ return [
+ [\OCP\Constants::PERMISSION_ALL, 'file', false, false, 'RGDNVW'],
+ [\OCP\Constants::PERMISSION_ALL, 'dir', false, false, 'RGDNVCK'],
+ [\OCP\Constants::PERMISSION_ALL, 'file', true, false, 'SRGDNVW'],
+ [\OCP\Constants::PERMISSION_ALL, 'file', true, true, 'SRMGDNVW'],
+ [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_SHARE, 'file', true, false, 'SGDNVW'],
+ [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_UPDATE, 'file', false, false, 'RGD'],
+ [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_DELETE, 'file', false, false, 'RGNVW'],
+ [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE, 'file', false, false, 'RGDNVW'],
+ [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_READ, 'file', false, false, 'RDNVW'],
+ [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE, 'dir', false, false, 'RGDNV'],
+ [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_READ, 'dir', false, false, 'RDNVCK'],
+ ];
}
/**
@@ -63,7 +63,7 @@ class NodeTest extends \Test\TestCase {
public function testDavPermissions($permissions, $type, $shared, $mounted, $expected) {
$info = $this->getMockBuilder(FileInfo::class)
->disableOriginalConstructor()
- ->setMethods(array('getPermissions', 'isShared', 'isMounted', 'getType'))
+ ->setMethods(['getPermissions', 'isShared', 'isMounted', 'getType'])
->getMock();
$info->expects($this->any())
->method('getPermissions')
diff --git a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
index 76ebbe30189..3a2c8d8c438 100644
--- a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
@@ -201,72 +201,72 @@ class ObjectTreeTest extends \Test\TestCase {
}
function nodeForPathProvider() {
- return array(
+ return [
// regular file
- array(
+ [
'regularfile.txt',
'regularfile.txt',
'regularfile.txt',
'file',
false
- ),
+ ],
// regular directory
- array(
+ [
'regulardir',
'regulardir',
'regulardir',
'dir',
false
- ),
+ ],
// regular file with chunking
- array(
+ [
'regularfile.txt',
'regularfile.txt',
'regularfile.txt',
'file',
true
- ),
+ ],
// regular directory with chunking
- array(
+ [
'regulardir',
'regulardir',
'regulardir',
'dir',
true
- ),
+ ],
// file with chunky file name
- array(
+ [
'regularfile.txt-chunking-123566789-10-1',
'regularfile.txt',
'regularfile.txt',
'file',
true
- ),
+ ],
// regular file in subdir
- array(
+ [
'subdir/regularfile.txt',
'subdir/regularfile.txt',
'regularfile.txt',
'file',
false
- ),
+ ],
// regular directory in subdir
- array(
+ [
'subdir/regulardir',
'subdir/regulardir',
'regulardir',
'dir',
false
- ),
+ ],
// file with chunky file name in subdir
- array(
+ [
'subdir/regularfile.txt-chunking-123566789-10-1',
'subdir/regularfile.txt',
'regularfile.txt',
'file',
true
- ),
- );
+ ],
+ ];
}
diff --git a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php
index 57613c19f64..55528a0f87f 100644
--- a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php
@@ -410,7 +410,7 @@ class PrincipalTest extends TestCase {
}
public function testUpdatePrincipal() {
- $this->assertSame(0, $this->connector->updatePrincipal('foo', new PropPatch(array())));
+ $this->assertSame(0, $this->connector->updatePrincipal('foo', new PropPatch([])));
}
public function testSearchPrincipalsWithEmptySearchProperties() {
diff --git a/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php
index 50b3ff1c394..d7554741fc0 100644
--- a/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php
@@ -112,30 +112,30 @@ class QuotaPluginTest extends TestCase {
}
public function quotaOkayProvider() {
- return array(
- array(1024, array()),
- array(1024, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
- array(1024, array('CONTENT-LENGTH' => '512')),
- array(1024, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
-
- array(FileInfo::SPACE_UNKNOWN, array()),
- array(FileInfo::SPACE_UNKNOWN, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
- array(FileInfo::SPACE_UNKNOWN, array('CONTENT-LENGTH' => '512')),
- array(FileInfo::SPACE_UNKNOWN, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
-
- array(FileInfo::SPACE_UNLIMITED, array()),
- array(FileInfo::SPACE_UNLIMITED, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
- array(FileInfo::SPACE_UNLIMITED, array('CONTENT-LENGTH' => '512')),
- array(FileInfo::SPACE_UNLIMITED, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
- );
+ return [
+ [1024, []],
+ [1024, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+ [1024, ['CONTENT-LENGTH' => '512']],
+ [1024, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
+
+ [FileInfo::SPACE_UNKNOWN, []],
+ [FileInfo::SPACE_UNKNOWN, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+ [FileInfo::SPACE_UNKNOWN, ['CONTENT-LENGTH' => '512']],
+ [FileInfo::SPACE_UNKNOWN, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
+
+ [FileInfo::SPACE_UNLIMITED, []],
+ [FileInfo::SPACE_UNLIMITED, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+ [FileInfo::SPACE_UNLIMITED, ['CONTENT-LENGTH' => '512']],
+ [FileInfo::SPACE_UNLIMITED, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
+ ];
}
public function quotaExceededProvider() {
- return array(
- array(1023, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
- array(511, array('CONTENT-LENGTH' => '512')),
- array(2047, array('OC-TOTAL-LENGTH' => '2048', 'CONTENT-LENGTH' => '1024')),
- );
+ return [
+ [1023, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+ [511, ['CONTENT-LENGTH' => '512']],
+ [2047, ['OC-TOTAL-LENGTH' => '2048', 'CONTENT-LENGTH' => '1024']],
+ ];
}
public function lengthProvider() {
@@ -155,22 +155,22 @@ class QuotaPluginTest extends TestCase {
}
public function quotaChunkedOkProvider() {
- return array(
- array(1024, 0, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
- array(1024, 0, array('CONTENT-LENGTH' => '512')),
- array(1024, 0, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
+ return [
+ [1024, 0, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+ [1024, 0, ['CONTENT-LENGTH' => '512']],
+ [1024, 0, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
// with existing chunks (allowed size = total length - chunk total size)
- array(400, 128, array('X-EXPECTED-ENTITY-LENGTH' => '512')),
- array(400, 128, array('CONTENT-LENGTH' => '512')),
- array(400, 128, array('OC-TOTAL-LENGTH' => '512', 'CONTENT-LENGTH' => '500')),
+ [400, 128, ['X-EXPECTED-ENTITY-LENGTH' => '512']],
+ [400, 128, ['CONTENT-LENGTH' => '512']],
+ [400, 128, ['OC-TOTAL-LENGTH' => '512', 'CONTENT-LENGTH' => '500']],
// \OCP\Files\FileInfo::SPACE-UNKNOWN = -2
- array(-2, 0, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
- array(-2, 0, array('CONTENT-LENGTH' => '512')),
- array(-2, 0, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
- array(-2, 128, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
- array(-2, 128, array('CONTENT-LENGTH' => '512')),
- array(-2, 128, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
- );
+ [-2, 0, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+ [-2, 0, ['CONTENT-LENGTH' => '512']],
+ [-2, 0, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
+ [-2, 128, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+ [-2, 128, ['CONTENT-LENGTH' => '512']],
+ [-2, 128, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
+ ];
}
/**
@@ -197,15 +197,15 @@ class QuotaPluginTest extends TestCase {
}
public function quotaChunkedFailProvider() {
- return array(
- array(400, 0, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
- array(400, 0, array('CONTENT-LENGTH' => '512')),
- array(400, 0, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
+ return [
+ [400, 0, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+ [400, 0, ['CONTENT-LENGTH' => '512']],
+ [400, 0, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
// with existing chunks (allowed size = total length - chunk total size)
- array(380, 128, array('X-EXPECTED-ENTITY-LENGTH' => '512')),
- array(380, 128, array('CONTENT-LENGTH' => '512')),
- array(380, 128, array('OC-TOTAL-LENGTH' => '512', 'CONTENT-LENGTH' => '500')),
- );
+ [380, 128, ['X-EXPECTED-ENTITY-LENGTH' => '512']],
+ [380, 128, ['CONTENT-LENGTH' => '512']],
+ [380, 128, ['OC-TOTAL-LENGTH' => '512', 'CONTENT-LENGTH' => '500']],
+ ];
}
/**
diff --git a/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php
index c1eaaae42c3..c0450d3bbb6 100644
--- a/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php
@@ -108,8 +108,8 @@ class TagsPluginTest extends \Test\TestCase {
$this->tagger->expects($this->exactly($expectedCallCount))
->method('getTagsForObjects')
- ->with($this->equalTo(array(123)))
- ->willReturn(array(123 => $tags));
+ ->with($this->equalTo([123]))
+ ->willReturn([123 => $tags]);
$propFind = new \Sabre\DAV\PropFind(
'/dummyPath',
@@ -162,16 +162,16 @@ class TagsPluginTest extends \Test\TestCase {
->willReturn(123);
$node->expects($this->exactly($expectedCallCount))
->method('getChildren')
- ->willReturn(array($node1, $node2));
+ ->willReturn([$node1, $node2]);
$this->tagger->expects($this->exactly($expectedCallCount))
->method('getTagsForObjects')
- ->with($this->equalTo(array(123, 111, 222)))
+ ->with($this->equalTo([123, 111, 222]))
->willReturn(
- array(
+ [
111 => $tags,
123 => $tags
- )
+ ]
);
// simulate sabre recursive PROPFIND traversal
@@ -212,58 +212,58 @@ class TagsPluginTest extends \Test\TestCase {
}
function tagsGetPropertiesDataProvider() {
- return array(
+ return [
// request both, receive both
- array(
- array('tag1', 'tag2', self::TAG_FAVORITE),
- array(self::TAGS_PROPERTYNAME, self::FAVORITE_PROPERTYNAME),
- array(
- 200 => array(
- self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array('tag1', 'tag2')),
+ [
+ ['tag1', 'tag2', self::TAG_FAVORITE],
+ [self::TAGS_PROPERTYNAME, self::FAVORITE_PROPERTYNAME],
+ [
+ 200 => [
+ self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(['tag1', 'tag2']),
self::FAVORITE_PROPERTYNAME => true,
- )
- )
- ),
+ ]
+ ]
+ ],
// request tags alone
- array(
- array('tag1', 'tag2', self::TAG_FAVORITE),
- array(self::TAGS_PROPERTYNAME),
- array(
- 200 => array(
- self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array('tag1', 'tag2')),
- )
- )
- ),
+ [
+ ['tag1', 'tag2', self::TAG_FAVORITE],
+ [self::TAGS_PROPERTYNAME],
+ [
+ 200 => [
+ self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(['tag1', 'tag2']),
+ ]
+ ]
+ ],
// request fav alone
- array(
- array('tag1', 'tag2', self::TAG_FAVORITE),
- array(self::FAVORITE_PROPERTYNAME),
- array(
- 200 => array(
+ [
+ ['tag1', 'tag2', self::TAG_FAVORITE],
+ [self::FAVORITE_PROPERTYNAME],
+ [
+ 200 => [
self::FAVORITE_PROPERTYNAME => true,
- )
- )
- ),
+ ]
+ ]
+ ],
// request none
- array(
- array('tag1', 'tag2', self::TAG_FAVORITE),
- array(),
- array(
- 200 => array()
- ),
- ),
+ [
+ ['tag1', 'tag2', self::TAG_FAVORITE],
+ [],
+ [
+ 200 => []
+ ],
+ ],
// request both with none set, receive both
- array(
- array(),
- array(self::TAGS_PROPERTYNAME, self::FAVORITE_PROPERTYNAME),
- array(
- 200 => array(
- self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array()),
+ [
+ [],
+ [self::TAGS_PROPERTYNAME, self::FAVORITE_PROPERTYNAME],
+ [
+ 200 => [
+ self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList([]),
self::FAVORITE_PROPERTYNAME => false,
- )
- )
- ),
- );
+ ]
+ ]
+ ],
+ ];
}
public function testUpdateTags() {
@@ -283,8 +283,8 @@ class TagsPluginTest extends \Test\TestCase {
$this->tagger->expects($this->at(0))
->method('getTagsForObjects')
- ->with($this->equalTo(array(123)))
- ->willReturn(array(123 => array('tagkeep', 'tagremove', self::TAG_FAVORITE)));
+ ->with($this->equalTo([123]))
+ ->willReturn([123 => ['tagkeep', 'tagremove', self::TAG_FAVORITE]]);
// then tag as tag1 and tag2
$this->tagger->expects($this->at(1))
@@ -300,9 +300,9 @@ class TagsPluginTest extends \Test\TestCase {
->with(123, 'tagremove');
// properties to set
- $propPatch = new \Sabre\DAV\PropPatch(array(
- self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array('tag1', 'tag2', 'tagkeep'))
- ));
+ $propPatch = new \Sabre\DAV\PropPatch([
+ self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(['tag1', 'tag2', 'tagkeep'])
+ ]);
$this->plugin->handleUpdateProperties(
'/dummypath',
@@ -334,8 +334,8 @@ class TagsPluginTest extends \Test\TestCase {
$this->tagger->expects($this->at(0))
->method('getTagsForObjects')
- ->with($this->equalTo(array(123)))
- ->willReturn(array());
+ ->with($this->equalTo([123]))
+ ->willReturn([]);
// then tag as tag1 and tag2
$this->tagger->expects($this->at(1))
@@ -346,9 +346,9 @@ class TagsPluginTest extends \Test\TestCase {
->with(123, 'tag2');
// properties to set
- $propPatch = new \Sabre\DAV\PropPatch(array(
- self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array('tag1', 'tag2', 'tagkeep'))
- ));
+ $propPatch = new \Sabre\DAV\PropPatch([
+ self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(['tag1', 'tag2', 'tagkeep'])
+ ]);
$this->plugin->handleUpdateProperties(
'/dummypath',
@@ -386,9 +386,9 @@ class TagsPluginTest extends \Test\TestCase {
->with(123, self::TAG_FAVORITE);
// properties to set
- $propPatch = new \Sabre\DAV\PropPatch(array(
+ $propPatch = new \Sabre\DAV\PropPatch([
self::FAVORITE_PROPERTYNAME => true
- ));
+ ]);
$this->plugin->handleUpdateProperties(
'/dummypath',
@@ -411,9 +411,9 @@ class TagsPluginTest extends \Test\TestCase {
->with(123, self::TAG_FAVORITE);
// properties to set
- $propPatch = new \Sabre\DAV\PropPatch(array(
+ $propPatch = new \Sabre\DAV\PropPatch([
self::FAVORITE_PROPERTYNAME => false
- ));
+ ]);
$this->plugin->handleUpdateProperties(
'/dummypath',
diff --git a/apps/dav/tests/unit/DAV/GroupPrincipalTest.php b/apps/dav/tests/unit/DAV/GroupPrincipalTest.php
index 08239dfd46a..6a78c2a0862 100644
--- a/apps/dav/tests/unit/DAV/GroupPrincipalTest.php
+++ b/apps/dav/tests/unit/DAV/GroupPrincipalTest.php
@@ -184,7 +184,7 @@ class GroupPrincipalTest extends \Test\TestCase {
}
public function testUpdatePrincipal() {
- $this->assertSame(0, $this->connector->updatePrincipal('foo', new PropPatch(array())));
+ $this->assertSame(0, $this->connector->updatePrincipal('foo', new PropPatch([])));
}
public function testSearchPrincipalsWithEmptySearchProperties() {
diff --git a/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php b/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php
index f634c717093..ecd65e7587c 100644
--- a/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php
+++ b/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php
@@ -308,12 +308,12 @@ class SystemTagPluginTest extends \Test\TestCase {
->with($systemTag, ['group1', 'group2']);
// properties to set
- $propPatch = new \Sabre\DAV\PropPatch(array(
+ $propPatch = new \Sabre\DAV\PropPatch([
self::DISPLAYNAME_PROPERTYNAME => 'Test changed',
self::USERVISIBLE_PROPERTYNAME => 'false',
self::USERASSIGNABLE_PROPERTYNAME => 'true',
self::GROUPS_PROPERTYNAME => 'group1|group2',
- ));
+ ]);
$this->plugin->handleUpdateProperties(
'/systemtag/1',
@@ -364,9 +364,9 @@ class SystemTagPluginTest extends \Test\TestCase {
->method('setTagGroups');
// properties to set
- $propPatch = new \Sabre\DAV\PropPatch(array(
+ $propPatch = new \Sabre\DAV\PropPatch([
self::GROUPS_PROPERTYNAME => 'group1|group2',
- ));
+ ]);
$this->plugin->handleUpdateProperties(
'/systemtag/1',