summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/App/AppStore/Fetcher/AppFetcherTest.php12
-rw-r--r--tests/lib/App/AppStore/Fetcher/FetcherBase.php8
-rw-r--r--tests/lib/AppFramework/Http/RequestTest.php6
-rw-r--r--tests/lib/Authentication/TwoFactorAuth/ManagerTest.php2
-rw-r--r--tests/lib/Collaboration/Collaborators/GroupPluginTest.php2
-rw-r--r--tests/lib/Collaboration/Collaborators/MailPluginTest.php2
-rw-r--r--tests/lib/Collaboration/Collaborators/UserPluginTest.php4
-rw-r--r--tests/lib/Comments/CommentTest.php2
-rw-r--r--tests/lib/DB/MigrationsTest.php4
-rw-r--r--tests/lib/Files/FilesystemTest.php2
-rw-r--r--tests/lib/Files/ViewTest.php2
-rw-r--r--tests/lib/L10N/FactoryTest.php2
-rw-r--r--tests/lib/Preview/GeneratorTest.php10
-rw-r--r--tests/lib/Share/Backend.php4
-rw-r--r--tests/lib/Template/JSCombinerTest.php20
-rw-r--r--tests/lib/Template/SCSSCacherTest.php30
16 files changed, 56 insertions, 56 deletions
diff --git a/tests/lib/App/AppStore/Fetcher/AppFetcherTest.php b/tests/lib/App/AppStore/Fetcher/AppFetcherTest.php
index 9b772ca5bfc..3390e08881b 100644
--- a/tests/lib/App/AppStore/Fetcher/AppFetcherTest.php
+++ b/tests/lib/App/AppStore/Fetcher/AppFetcherTest.php
@@ -1866,9 +1866,9 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
->willReturnCallback(function ($key, $default) {
if ($key === 'appstoreenabled') {
return true;
- } else if ($key === 'version') {
+ } elseif ($key === 'version') {
return '11.0.0.2';
- } else if ($key === 'appstoreurl' && $default === 'https://apps.nextcloud.com/api/v1') {
+ } elseif ($key === 'appstoreurl' && $default === 'https://apps.nextcloud.com/api/v1') {
return 'https://custom.appsstore.endpoint/api/v1';
} else {
return $default;
@@ -1949,7 +1949,7 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
->willReturnCallback(function ($var, $default) {
if ($var === 'appstoreenabled') {
return false;
- } else if ($var === 'version') {
+ } elseif ($var === 'version') {
return '11.0.0.2';
}
return $default;
@@ -1968,7 +1968,7 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
->willReturnCallback(function ($var, $default) {
if ($var === 'has_internet_connection') {
return false;
- } else if ($var === 'version') {
+ } elseif ($var === 'version') {
return '11.0.0.2';
}
return $default;
@@ -1985,9 +1985,9 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
->willReturnCallback(function ($key, $default) {
if ($key === 'appstoreenabled') {
return true;
- } else if ($key === 'version') {
+ } elseif ($key === 'version') {
return '10.0.7.2';
- } else if ($key === 'appstoreurl' && $default === 'https://apps.nextcloud.com/api/v1') {
+ } elseif ($key === 'appstoreurl' && $default === 'https://apps.nextcloud.com/api/v1') {
return 'https://custom.appsstore.endpoint/api/v1';
} else {
return $default;
diff --git a/tests/lib/App/AppStore/Fetcher/FetcherBase.php b/tests/lib/App/AppStore/Fetcher/FetcherBase.php
index 11813c7f3bd..cfe0af40483 100644
--- a/tests/lib/App/AppStore/Fetcher/FetcherBase.php
+++ b/tests/lib/App/AppStore/Fetcher/FetcherBase.php
@@ -213,7 +213,7 @@ abstract class FetcherBase extends TestCase {
->willReturnCallback(function ($key, $default) {
if ($key === 'appstoreenabled') {
return true;
- } else if ($key === 'version') {
+ } elseif ($key === 'version') {
return '11.0.0.2';
} else {
return $default;
@@ -506,7 +506,7 @@ abstract class FetcherBase extends TestCase {
->willReturnCallback(function ($key, $default) {
if ($key === 'appstoreenabled') {
return true;
- } else if ($key === 'version') {
+ } elseif ($key === 'version') {
return '11.0.0.2';
} else {
return $default;
@@ -587,7 +587,7 @@ abstract class FetcherBase extends TestCase {
->willReturnCallback(function ($key, $default) {
if ($key === 'appstoreenabled') {
return true;
- } else if ($key === 'version') {
+ } elseif ($key === 'version') {
return '11.0.0.2';
} else {
return $default;
@@ -674,7 +674,7 @@ abstract class FetcherBase extends TestCase {
->willReturnCallback(function ($key, $default) {
if ($key === 'appstoreenabled') {
return true;
- } else if ($key === 'version') {
+ } elseif ($key === 'version') {
return '11.0.0.3';
} else {
return $default;
diff --git a/tests/lib/AppFramework/Http/RequestTest.php b/tests/lib/AppFramework/Http/RequestTest.php
index e5a3e88d98e..819eb666d7b 100644
--- a/tests/lib/AppFramework/Http/RequestTest.php
+++ b/tests/lib/AppFramework/Http/RequestTest.php
@@ -1120,7 +1120,7 @@ class RequestTest extends \Test\TestCase {
->willReturnCallback(function ($key, $default) {
if ($key === 'overwritecondaddr') {
return '';
- } else if ($key === 'overwritehost') {
+ } elseif ($key === 'overwritehost') {
return 'my.overwritten.host';
}
@@ -1144,7 +1144,7 @@ class RequestTest extends \Test\TestCase {
->willReturnCallback(function ($key, $default) {
if ($key === 'trusted_proxies') {
return ['1.2.3.4'];
- } else if ($key === 'trusted_domains') {
+ } elseif ($key === 'trusted_domains') {
return ['my.trusted.host'];
}
@@ -1173,7 +1173,7 @@ class RequestTest extends \Test\TestCase {
->willReturnCallback(function ($key, $default) {
if ($key === 'trusted_proxies') {
return ['1.2.3.4'];
- } else if ($key === 'trusted_domains') {
+ } elseif ($key === 'trusted_domains') {
return ['my.trusted.host'];
}
diff --git a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
index 95eff5f08a9..051f2936ad7 100644
--- a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
+++ b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
@@ -632,7 +632,7 @@ class ManagerTest extends TestCase {
->willReturnCallback(function ($var) {
if ($var === Manager::SESSION_UID_KEY) {
return false;
- } else if ($var === 'app_password') {
+ } elseif ($var === 'app_password') {
return false;
}
return true;
diff --git a/tests/lib/Collaboration/Collaborators/GroupPluginTest.php b/tests/lib/Collaboration/Collaborators/GroupPluginTest.php
index b4a9b3d0955..ac84ef04d33 100644
--- a/tests/lib/Collaboration/Collaborators/GroupPluginTest.php
+++ b/tests/lib/Collaboration/Collaborators/GroupPluginTest.php
@@ -463,7 +463,7 @@ class GroupPluginTest extends TestCase {
{
if ($appName === 'core' && $key === 'shareapi_only_share_with_group_members') {
return $shareWithGroupOnly ? 'yes' : 'no';
- } else if ($appName === 'core' && $key === 'shareapi_allow_share_dialog_user_enumeration') {
+ } elseif ($appName === 'core' && $key === 'shareapi_allow_share_dialog_user_enumeration') {
return $shareeEnumeration ? 'yes' : 'no';
}
return $default;
diff --git a/tests/lib/Collaboration/Collaborators/MailPluginTest.php b/tests/lib/Collaboration/Collaborators/MailPluginTest.php
index 5a690393d6c..f2d4ce0cf70 100644
--- a/tests/lib/Collaboration/Collaborators/MailPluginTest.php
+++ b/tests/lib/Collaboration/Collaborators/MailPluginTest.php
@@ -536,7 +536,7 @@ class MailPluginTest extends TestCase {
function ($appName, $key, $default) {
if ($appName === 'core' && $key === 'shareapi_allow_share_dialog_user_enumeration') {
return 'yes';
- } else if ($appName === 'core' && $key === 'shareapi_only_share_with_group_members') {
+ } elseif ($appName === 'core' && $key === 'shareapi_only_share_with_group_members') {
return 'yes';
}
return $default;
diff --git a/tests/lib/Collaboration/Collaborators/UserPluginTest.php b/tests/lib/Collaboration/Collaborators/UserPluginTest.php
index bacf68f652e..bba061f8e2b 100644
--- a/tests/lib/Collaboration/Collaborators/UserPluginTest.php
+++ b/tests/lib/Collaboration/Collaborators/UserPluginTest.php
@@ -97,9 +97,9 @@ class UserPluginTest extends TestCase {
function ($appName, $key, $default) use ($shareWithGroupOnly, $shareeEnumeration, $shareeEnumerationLimitToGroup) {
if ($appName === 'core' && $key === 'shareapi_only_share_with_group_members') {
return $shareWithGroupOnly ? 'yes' : 'no';
- } else if ($appName === 'core' && $key === 'shareapi_allow_share_dialog_user_enumeration') {
+ } elseif ($appName === 'core' && $key === 'shareapi_allow_share_dialog_user_enumeration') {
return $shareeEnumeration ? 'yes' : 'no';
- } else if ($appName === 'core' && $key === 'shareapi_restrict_user_enumeration_to_group') {
+ } elseif ($appName === 'core' && $key === 'shareapi_restrict_user_enumeration_to_group') {
return $shareeEnumerationLimitToGroup ? 'yes' : 'no';
}
return $default;
diff --git a/tests/lib/Comments/CommentTest.php b/tests/lib/Comments/CommentTest.php
index 686c2bcd19e..733597c2b4c 100644
--- a/tests/lib/Comments/CommentTest.php
+++ b/tests/lib/Comments/CommentTest.php
@@ -181,7 +181,7 @@ class CommentTest extends TestCase {
while($mention = array_shift($mentions)) {
if ($mention['type'] === 'user') {
$id = array_shift($expectedUids);
- } else if ($mention['type'] === 'guest') {
+ } elseif ($mention['type'] === 'guest') {
$id = array_shift($expectedGuests);
} else {
$this->fail('Unexpected mention type');
diff --git a/tests/lib/DB/MigrationsTest.php b/tests/lib/DB/MigrationsTest.php
index 15415a4061c..52e849fd0a8 100644
--- a/tests/lib/DB/MigrationsTest.php
+++ b/tests/lib/DB/MigrationsTest.php
@@ -326,7 +326,7 @@ class MigrationsTest extends \Test\TestCase {
$defaultName = 'PRIMARY';
if ($this->db->getDatabasePlatform() instanceof PostgreSqlPlatform) {
$defaultName = \str_repeat('a', 26) . '_' . \str_repeat('b', 30) . '_seq';
- } else if ($this->db->getDatabasePlatform() instanceof OraclePlatform) {
+ } elseif ($this->db->getDatabasePlatform() instanceof OraclePlatform) {
$defaultName = \str_repeat('a', 26) . '_seq';
}
@@ -407,7 +407,7 @@ class MigrationsTest extends \Test\TestCase {
$defaultName = 'PRIMARY';
if ($this->db->getDatabasePlatform() instanceof PostgreSqlPlatform) {
$defaultName = \str_repeat('a', 27) . '_' . \str_repeat('b', 30) . '_seq';
- } else if ($this->db->getDatabasePlatform() instanceof OraclePlatform) {
+ } elseif ($this->db->getDatabasePlatform() instanceof OraclePlatform) {
$defaultName = \str_repeat('a', 27) . '_seq';
}
diff --git a/tests/lib/Files/FilesystemTest.php b/tests/lib/Files/FilesystemTest.php
index 39545b542e7..5bf998df562 100644
--- a/tests/lib/Files/FilesystemTest.php
+++ b/tests/lib/Files/FilesystemTest.php
@@ -391,7 +391,7 @@ class FilesystemTest extends \Test\TestCase {
$this->assertTrue($homeMount->instanceOfStorage('\OCP\Files\IHomeStorage'));
if ($homeMount->instanceOfStorage('\OC\Files\ObjectStore\HomeObjectStoreStorage')) {
$this->assertEquals('object::user:' . $userId, $homeMount->getId());
- } else if ($homeMount->instanceOfStorage('\OC\Files\Storage\Home')) {
+ } elseif ($homeMount->instanceOfStorage('\OC\Files\Storage\Home')) {
$this->assertEquals('home::' . $userId, $homeMount->getId());
}
diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php
index c1da385a3cc..369c94c3530 100644
--- a/tests/lib/Files/ViewTest.php
+++ b/tests/lib/Files/ViewTest.php
@@ -2469,7 +2469,7 @@ class ViewTest extends \Test\TestCase {
private function getFileLockType(View $view, $path, $onMountPoint = false) {
if ($this->isFileLocked($view, $path, ILockingProvider::LOCK_EXCLUSIVE, $onMountPoint)) {
return ILockingProvider::LOCK_EXCLUSIVE;
- } else if ($this->isFileLocked($view, $path, ILockingProvider::LOCK_SHARED, $onMountPoint)) {
+ } elseif ($this->isFileLocked($view, $path, ILockingProvider::LOCK_SHARED, $onMountPoint)) {
return ILockingProvider::LOCK_SHARED;
}
return null;
diff --git a/tests/lib/L10N/FactoryTest.php b/tests/lib/L10N/FactoryTest.php
index 33667e26fe8..73e38145d54 100644
--- a/tests/lib/L10N/FactoryTest.php
+++ b/tests/lib/L10N/FactoryTest.php
@@ -513,7 +513,7 @@ class FactoryTest extends TestCase {
->willReturnCallback(function ($var, $default) use ($defaultLang) {
if ($var === 'installed') {
return true;
- } else if ($var === 'default_language') {
+ } elseif ($var === 'default_language') {
return $defaultLang;
} else {
return $default;
diff --git a/tests/lib/Preview/GeneratorTest.php b/tests/lib/Preview/GeneratorTest.php
index 80293102631..919f7198c08 100644
--- a/tests/lib/Preview/GeneratorTest.php
+++ b/tests/lib/Preview/GeneratorTest.php
@@ -171,13 +171,13 @@ class GeneratorTest extends \Test\TestCase {
->willReturnCallback(function ($provider) use ($invalidProvider, $validProvider, $unavailableProvider) {
if ($provider === 'wrongProvider') {
$this->fail('Wrongprovider should not be constructed!');
- } else if ($provider === 'brokenProvider') {
+ } elseif ($provider === 'brokenProvider') {
return false;
- } else if ($provider === 'invalidProvider') {
+ } elseif ($provider === 'invalidProvider') {
return $invalidProvider;
- } else if ($provider === 'validProvider') {
+ } elseif ($provider === 'validProvider') {
return $validProvider;
- } else if ($provider === 'unavailableProvider') {
+ } elseif ($provider === 'unavailableProvider') {
return $unavailableProvider;
}
$this->fail('Unexpected provider requested');
@@ -213,7 +213,7 @@ class GeneratorTest extends \Test\TestCase {
->willReturnCallback(function ($filename) use ($maxPreview, $previewFile) {
if ($filename === '2048-2048-max.png') {
return $maxPreview;
- } else if ($filename === '256-256.png') {
+ } elseif ($filename === '256-256.png') {
return $previewFile;
}
$this->fail('Unexpected file');
diff --git a/tests/lib/Share/Backend.php b/tests/lib/Share/Backend.php
index 72451d54567..a0d45b9b782 100644
--- a/tests/lib/Share/Backend.php
+++ b/tests/lib/Share/Backend.php
@@ -77,9 +77,9 @@ class Backend implements \OCP\Share_Backend {
foreach ($items as $item) {
if ($format === self::FORMAT_SOURCE) {
$testItems[] = $item['item_source'];
- } else if ($format === self::FORMAT_TARGET) {
+ } elseif ($format === self::FORMAT_TARGET) {
$testItems[] = $item['item_target'];
- } else if ($format === self::FORMAT_PERMISSIONS) {
+ } elseif ($format === self::FORMAT_PERMISSIONS) {
$testItems[] = $item['permissions'];
}
}
diff --git a/tests/lib/Template/JSCombinerTest.php b/tests/lib/Template/JSCombinerTest.php
index b892749806d..abafc583ccf 100644
--- a/tests/lib/Template/JSCombinerTest.php
+++ b/tests/lib/Template/JSCombinerTest.php
@@ -123,9 +123,9 @@ class JSCombinerTest extends \Test\TestCase {
->willReturnCallback(function ($path) use ($file, $gzfile) {
if ($path === 'combine.js') {
return $file;
- } else if ($path === 'combine.js.deps') {
+ } elseif ($path === 'combine.js.deps') {
throw new NotFoundException();
- } else if ($path === 'combine.js.gzip') {
+ } elseif ($path === 'combine.js.gzip') {
return $gzfile;
}
$this->fail();
@@ -160,9 +160,9 @@ class JSCombinerTest extends \Test\TestCase {
->willReturnCallback(function ($path) use ($file, $gzfile) {
if ($path === 'combine.js') {
return $file;
- } else if ($path === 'combine.js.deps') {
+ } elseif ($path === 'combine.js.deps') {
throw new NotFoundException();
- } else if ($path === 'combine.js.gzip') {
+ } elseif ($path === 'combine.js.gzip') {
return $gzfile;
}
$this->fail();
@@ -348,9 +348,9 @@ class JSCombinerTest extends \Test\TestCase {
function ($filename) use ($file, $depsFile, $gzFile) {
if ($filename === 'combine.js') {
return $file;
- } else if ($filename === 'combine.js.deps') {
+ } elseif ($filename === 'combine.js.deps') {
return $depsFile;
- } else if ($filename === 'combine.js.gzip') {
+ } elseif ($filename === 'combine.js.gzip') {
return $gzFile;
}
$this->fail();
@@ -379,9 +379,9 @@ class JSCombinerTest extends \Test\TestCase {
function ($filename) use ($file, $depsFile, $gzFile) {
if ($filename === 'combine.js') {
return $file;
- } else if ($filename === 'combine.js.deps') {
+ } elseif ($filename === 'combine.js.deps') {
return $depsFile;
- } else if ($filename === 'combine.js.gzip') {
+ } elseif ($filename === 'combine.js.gzip') {
return $gzFile;
}
$this->fail();
@@ -447,9 +447,9 @@ var b = \'world\';
function ($filename) use ($file, $depsFile, $gzFile) {
if ($filename === 'combine.js') {
return $file;
- } else if ($filename === 'combine.js.deps') {
+ } elseif ($filename === 'combine.js.deps') {
return $depsFile;
- } else if ($filename === 'combine.js.gzip') {
+ } elseif ($filename === 'combine.js.gzip') {
return $gzFile;
}
$this->fail();
diff --git a/tests/lib/Template/SCSSCacherTest.php b/tests/lib/Template/SCSSCacherTest.php
index 5760ea7f8e0..09ab9363d95 100644
--- a/tests/lib/Template/SCSSCacherTest.php
+++ b/tests/lib/Template/SCSSCacherTest.php
@@ -123,9 +123,9 @@ class SCSSCacherTest extends \Test\TestCase {
->willReturnCallback(function ($path) use ($file, $gzfile, $filePrefix) {
if ($path === $filePrefix.'styles.css') {
return $file;
- } else if ($path === $filePrefix.'styles.css.deps') {
+ } elseif ($path === $filePrefix.'styles.css.deps') {
throw new NotFoundException();
- } else if ($path === $filePrefix.'styles.css.gzip') {
+ } elseif ($path === $filePrefix.'styles.css.gzip') {
return $gzfile;
} else {
$this->fail();
@@ -163,9 +163,9 @@ class SCSSCacherTest extends \Test\TestCase {
->willReturnCallback(function ($path) use ($file, $gzfile, $filePrefix) {
if ($path === $filePrefix.'styles.css') {
return $file;
- } else if ($path === $filePrefix.'styles.css.deps') {
+ } elseif ($path === $filePrefix.'styles.css.deps') {
throw new NotFoundException();
- } else if ($path === $filePrefix.'styles.css.gzip') {
+ } elseif ($path === $filePrefix.'styles.css.gzip') {
return $gzfile;
}else {
$this->fail();
@@ -199,9 +199,9 @@ class SCSSCacherTest extends \Test\TestCase {
->willReturnCallback(function ($name) use ($file, $fileDeps, $gzFile, $filePrefix) {
if ($name === $filePrefix.'styles.css') {
return $file;
- } else if ($name === $filePrefix.'styles.css.deps') {
+ } elseif ($name === $filePrefix.'styles.css.deps') {
return $fileDeps;
- } else if ($name === $filePrefix.'styles.css.gzip') {
+ } elseif ($name === $filePrefix.'styles.css.gzip') {
return $gzFile;
}
$this->fail();
@@ -237,9 +237,9 @@ class SCSSCacherTest extends \Test\TestCase {
->willReturnCallback(function ($name) use ($file, $fileDeps, $gzFile, $filePrefix) {
if ($name === $filePrefix.'styles.css') {
return $file;
- } else if ($name === $filePrefix.'styles.css.deps') {
+ } elseif ($name === $filePrefix.'styles.css.deps') {
return $fileDeps;
- } else if ($name === $filePrefix.'styles.css.gzip') {
+ } elseif ($name === $filePrefix.'styles.css.gzip') {
return $gzFile;
}
$this->fail();
@@ -275,7 +275,7 @@ class SCSSCacherTest extends \Test\TestCase {
->willReturnCallback(function ($path) use ($file) {
if ($path === 'styles.css') {
return $file;
- } else if ($path === 'styles.css.deps') {
+ } elseif ($path === 'styles.css.deps') {
throw new NotFoundException();
} else {
$this->fail();
@@ -303,9 +303,9 @@ class SCSSCacherTest extends \Test\TestCase {
$folder->method('newFile')->willReturnCallback(function ($fileName) use ($file, $depsFile, $gzipFile) {
if ($fileName === 'styles.css') {
return $file;
- } else if ($fileName === 'styles.css.deps') {
+ } elseif ($fileName === 'styles.css.deps') {
return $depsFile;
- } else if ($fileName === 'styles.css.gzip') {
+ } elseif ($fileName === 'styles.css.gzip') {
return $gzipFile;
}
throw new \Exception();
@@ -337,9 +337,9 @@ class SCSSCacherTest extends \Test\TestCase {
$folder->method('getFile')->willReturnCallback(function ($fileName) use ($file, $depsFile, $gzipFile) {
if ($fileName === 'styles.css') {
return $file;
- } else if ($fileName === 'styles.css.deps') {
+ } elseif ($fileName === 'styles.css.deps') {
return $depsFile;
- } else if ($fileName === 'styles.css.gzip') {
+ } elseif ($fileName === 'styles.css.gzip') {
return $gzipFile;
}
throw new \Exception();
@@ -371,9 +371,9 @@ class SCSSCacherTest extends \Test\TestCase {
$folder->method('getFile')->willReturnCallback(function ($fileName) use ($file, $depsFile, $gzipFile) {
if ($fileName === 'styles-success.css') {
return $file;
- } else if ($fileName === 'styles-success.css.deps') {
+ } elseif ($fileName === 'styles-success.css.deps') {
return $depsFile;
- } else if ($fileName === 'styles-success.css.gzip') {
+ } elseif ($fileName === 'styles-success.css.gzip') {
return $gzipFile;
}
throw new \Exception();