aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/tests
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-26 09:30:18 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-26 16:34:56 +0100
commitb80ebc96748b45fd2e0ba9323308657c4b00b7ec (patch)
treeec20e0ffa2f86b9b54939a83a785407319f94559 /apps/files_external/tests
parent62403d0932be7d620c7bdadc6b4e13eb496fcd6f (diff)
downloadnextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.tar.gz
nextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.zip
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/files_external/tests')
-rw-r--r--apps/files_external/tests/Controller/StoragesControllerTest.php26
-rw-r--r--apps/files_external/tests/Controller/UserStoragesControllerTest.php4
-rw-r--r--apps/files_external/tests/OwnCloudFunctionsTest.php68
-rw-r--r--apps/files_external/tests/Service/StoragesServiceTest.php12
-rw-r--r--apps/files_external/tests/Storage/FtpTest.php4
-rw-r--r--apps/files_external/tests/Storage/SmbTest.php2
-rw-r--r--apps/files_external/tests/config.php36
7 files changed, 76 insertions, 76 deletions
diff --git a/apps/files_external/tests/Controller/StoragesControllerTest.php b/apps/files_external/tests/Controller/StoragesControllerTest.php
index 3ecf47419b5..56311a7be4c 100644
--- a/apps/files_external/tests/Controller/StoragesControllerTest.php
+++ b/apps/files_external/tests/Controller/StoragesControllerTest.php
@@ -117,7 +117,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
'mount',
'\OCA\Files_External\Lib\Storage\SMB',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
@@ -159,7 +159,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
'mount',
'\OCA\Files_External\Lib\Storage\SMB',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
@@ -172,11 +172,11 @@ abstract class StoragesControllerTest extends \Test\TestCase {
}
function mountPointNamesProvider() {
- return array(
- array(''),
- array('/'),
- array('//'),
- );
+ return [
+ [''],
+ ['/'],
+ ['//'],
+ ];
}
/**
@@ -201,7 +201,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
$mountPoint,
'\OCA\Files_External\Lib\Storage\SMB',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
@@ -215,7 +215,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
$mountPoint,
'\OCA\Files_External\Lib\Storage\SMB',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
@@ -238,7 +238,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
'mount',
'\OC\Files\Storage\InvalidStorage',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
@@ -252,7 +252,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
'mount',
'\OC\Files\Storage\InvalidStorage',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
@@ -292,7 +292,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
'mount',
'\OCA\Files_External\Lib\Storage\SMB',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
@@ -388,7 +388,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
'mount',
'\OCA\Files_External\Lib\Storage\SMB',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
diff --git a/apps/files_external/tests/Controller/UserStoragesControllerTest.php b/apps/files_external/tests/Controller/UserStoragesControllerTest.php
index 7d8f60380c6..5f82121cf7a 100644
--- a/apps/files_external/tests/Controller/UserStoragesControllerTest.php
+++ b/apps/files_external/tests/Controller/UserStoragesControllerTest.php
@@ -86,7 +86,7 @@ class UserStoragesControllerTest extends StoragesControllerTest {
'mount',
'\OCA\Files_External\Lib\Storage\SMB',
'\Auth\Mechanism',
- array(),
+ [],
[],
[],
[],
@@ -100,7 +100,7 @@ class UserStoragesControllerTest extends StoragesControllerTest {
'mount',
'\OCA\Files_External\Lib\Storage\SMB',
'\Auth\Mechanism',
- array(),
+ [],
[],
[],
[],
diff --git a/apps/files_external/tests/OwnCloudFunctionsTest.php b/apps/files_external/tests/OwnCloudFunctionsTest.php
index d87288edb10..060f8c61a44 100644
--- a/apps/files_external/tests/OwnCloudFunctionsTest.php
+++ b/apps/files_external/tests/OwnCloudFunctionsTest.php
@@ -36,72 +36,72 @@ namespace OCA\Files_External\Tests;
class OwnCloudFunctionsTest extends \Test\TestCase {
function configUrlProvider() {
- return array(
- array(
- array(
+ return [
+ [
+ [
'host' => 'testhost',
'root' => 'testroot',
'secure' => false
- ),
+ ],
'http://testhost/remote.php/webdav/testroot/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'testhost',
'root' => 'testroot',
'secure' => true
- ),
+ ],
'https://testhost/remote.php/webdav/testroot/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'http://testhost',
'root' => 'testroot',
'secure' => false
- ),
+ ],
'http://testhost/remote.php/webdav/testroot/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'https://testhost',
'root' => 'testroot',
'secure' => false
- ),
+ ],
'https://testhost/remote.php/webdav/testroot/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'https://testhost/testroot',
'root' => '',
'secure' => false
- ),
+ ],
'https://testhost/testroot/remote.php/webdav/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'https://testhost/testroot',
'root' => 'subdir',
'secure' => false
- ),
+ ],
'https://testhost/testroot/remote.php/webdav/subdir/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'http://testhost/testroot',
'root' => 'subdir',
'secure' => true
- ),
+ ],
'http://testhost/testroot/remote.php/webdav/subdir/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'http://testhost/testroot/',
'root' => '/subdir',
'secure' => false
- ),
+ ],
'http://testhost/testroot/remote.php/webdav/subdir/',
- ),
- );
+ ],
+ ];
}
/**
diff --git a/apps/files_external/tests/Service/StoragesServiceTest.php b/apps/files_external/tests/Service/StoragesServiceTest.php
index 9d3a44042e0..dd35ee8f92c 100644
--- a/apps/files_external/tests/Service/StoragesServiceTest.php
+++ b/apps/files_external/tests/Service/StoragesServiceTest.php
@@ -95,7 +95,7 @@ abstract class StoragesServiceTest extends \Test\TestCase {
protected function setUp(): void {
parent::setUp();
$this->dbConfig = new CleaningDBConfig(\OC::$server->getDatabaseConnection(), \OC::$server->getCrypto());
- self::$hookCalls = array();
+ self::$hookCalls = [];
$config = \OC::$server->getConfig();
$this->dataDir = $config->getSystemValue(
'datadirectory',
@@ -177,7 +177,7 @@ abstract class StoragesServiceTest extends \Test\TestCase {
protected function tearDown(): void {
\OC_Mount_Config::$skipTest = false;
- self::$hookCalls = array();
+ self::$hookCalls = [];
if ($this->dbConfig) {
$this->dbConfig->clean();
}
@@ -448,17 +448,17 @@ abstract class StoragesServiceTest extends \Test\TestCase {
}
public static function createHookCallback($params) {
- self::$hookCalls[] = array(
+ self::$hookCalls[] = [
'signal' => Filesystem::signal_create_mount,
'params' => $params
- );
+ ];
}
public static function deleteHookCallback($params) {
- self::$hookCalls[] = array(
+ self::$hookCalls[] = [
'signal' => Filesystem::signal_delete_mount,
'params' => $params
- );
+ ];
}
/**
diff --git a/apps/files_external/tests/Storage/FtpTest.php b/apps/files_external/tests/Storage/FtpTest.php
index 65a1566ec1e..6b9ce2d5b31 100644
--- a/apps/files_external/tests/Storage/FtpTest.php
+++ b/apps/files_external/tests/Storage/FtpTest.php
@@ -63,11 +63,11 @@ class FtpTest extends \Test\Files\Storage\Storage {
}
public function testConstructUrl(){
- $config = array ( 'host' => 'localhost',
+ $config = [ 'host' => 'localhost',
'user' => 'ftp',
'password' => 'ftp',
'root' => '/',
- 'secure' => false );
+ 'secure' => false ];
$instance = new FTP($config);
$this->assertEquals('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
diff --git a/apps/files_external/tests/Storage/SmbTest.php b/apps/files_external/tests/Storage/SmbTest.php
index 2af9d00ebe9..87a5668be49 100644
--- a/apps/files_external/tests/Storage/SmbTest.php
+++ b/apps/files_external/tests/Storage/SmbTest.php
@@ -73,7 +73,7 @@ class SmbTest extends \Test\Files\Storage\Storage {
public function directoryProvider() {
// doesn't support leading/trailing spaces
- return array(array('folder'));
+ return [['folder']];
}
public function testRenameWithSpaces() {
diff --git a/apps/files_external/tests/config.php b/apps/files_external/tests/config.php
index a080b33e7fe..d6d3731c5a5 100644
--- a/apps/files_external/tests/config.php
+++ b/apps/files_external/tests/config.php
@@ -33,15 +33,15 @@ if (file_exists($privateConfigFile)) {
}
// this is now more a template now for your private configurations
-return array(
- 'ftp'=>array(
+return [
+ 'ftp'=>[
'run'=>false,
'host'=>'localhost',
'user'=>'test',
'password'=>'test',
'root'=>'/test',
- ),
- 'webdav'=>array(
+ ],
+ 'webdav'=>[
'run'=>false,
'host'=>'localhost',
'user'=>'test',
@@ -51,15 +51,15 @@ return array(
// (only in tests)
// set to higher value for lighttpd webdav
'wait'=> 0
- ),
- 'owncloud'=>array(
+ ],
+ 'owncloud'=>[
'run'=>false,
'host'=>'localhost/owncloud',
'user'=>'test',
'password'=>'test',
'root'=>'',
- ),
- 'swift' => array(
+ ],
+ 'swift' => [
'run' => false,
'user' => 'test',
'bucket' => 'test',
@@ -70,16 +70,16 @@ return array(
//'service_name' => 'swift', //should be 'swift' for OpenStack Object Storage and 'cloudFiles' for Rackspace Cloud Files (default value)
//'url' => 'https://identity.api.rackspacecloud.com/v2.0/', //to be used with Rackspace Cloud Files and OpenStack Object Storage
//'timeout' => 5 // timeout of HTTP requests in seconds
- ),
- 'smb'=>array(
+ ],
+ 'smb'=>[
'run'=>false,
'user'=>'test',
'password'=>'test',
'host'=>'localhost',
'share'=>'/test',
'root'=>'/test/',
- ),
- 'amazons3'=>array(
+ ],
+ 'amazons3'=>[
'run'=>false,
'key'=>'test',
'secret'=>'test',
@@ -90,20 +90,20 @@ return array(
//'region' => 'eu-west-1',
//'test'=>'true',
//'timeout'=>20
- ),
- 'sftp' => array (
+ ],
+ 'sftp' => [
'run'=>false,
'host'=>'localhost',
'user'=>'test',
'password'=>'test',
'root'=>'/test'
- ),
- 'sftp_key' => array (
+ ],
+ 'sftp_key' => [
'run'=>false,
'host'=>'localhost',
'user'=>'test',
'public_key'=>'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDJPTvz3OLonF2KSGEKP/nd4CPmRYvemG2T4rIiNYjDj0U5y+2sKEWbjiUlQl2bsqYuVoJ+/UNJlGQbbZ08kQirFeo1GoWBzqioaTjUJfbLN6TzVVKXxR9YIVmH7Ajg2iEeGCndGgbmnPfj+kF9TR9IH8vMVvtubQwf7uEwB0ALhw== phpseclib-generated-key',
'private_key'=>'test',
'root'=>'/test'
- ),
-);
+ ],
+];