aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/UtilTest.php
diff options
context:
space:
mode:
authorDaniel Rudolf <github.com@daniel-rudolf.de>2021-07-01 16:26:55 +0200
committerDaniel Rudolf <github.com@daniel-rudolf.de>2021-07-01 16:26:55 +0200
commit15a445f743ccf3bcdff69bf09e55367568411c36 (patch)
tree29dc7942b696a1190eb85aeae54e11c531d6756d /tests/lib/UtilTest.php
parente16bf707aab3c155f871f6ee6d60079932ecc014 (diff)
downloadnextcloud-server-15a445f743ccf3bcdff69bf09e55367568411c36.tar.gz
nextcloud-server-15a445f743ccf3bcdff69bf09e55367568411c36.zip
Move UtilTest::testDefaultApps() to UrlGeneratorTest
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
Diffstat (limited to 'tests/lib/UtilTest.php')
-rw-r--r--tests/lib/UtilTest.php62
1 files changed, 0 insertions, 62 deletions
diff --git a/tests/lib/UtilTest.php b/tests/lib/UtilTest.php
index 9a82f3c5ac6..04d4858fb26 100644
--- a/tests/lib/UtilTest.php
+++ b/tests/lib/UtilTest.php
@@ -9,7 +9,6 @@
namespace Test;
use OC_Util;
-use OCP\App\IAppManager;
/**
* Class UtilTest
@@ -170,67 +169,6 @@ class UtilTest extends \Test\TestCase {
}
/**
- * Test default apps
- *
- * @dataProvider defaultAppsProvider
- * @group DB
- */
- public function testDefaultApps($defaultAppConfig, $expectedPath, $enabledApps) {
- $oldDefaultApps = \OC::$server->getConfig()->getSystemValue('defaultapp', '');
- // CLI is doing messy stuff with the webroot, so need to work it around
- $oldWebRoot = \OC::$WEBROOT;
- \OC::$WEBROOT = '';
-
- $appManager = $this->createMock(IAppManager::class);
- $appManager->expects($this->any())
- ->method('isEnabledForUser')
- ->willReturnCallback(function ($appId) use ($enabledApps) {
- return in_array($appId, $enabledApps);
- });
- $this->overwriteService(IAppManager::class, $appManager);
-
- // need to set a user id to make sure enabled apps are read from cache
- \OC_User::setUserId($this->getUniqueID());
- \OC::$server->getConfig()->setSystemValue('defaultapp', $defaultAppConfig);
- $this->assertEquals('http://localhost/' . $expectedPath, OC_Util::getDefaultPageUrl());
-
- // restore old state
- \OC::$WEBROOT = $oldWebRoot;
- $this->restoreService(IAppManager::class);
- \OC::$server->getConfig()->setSystemValue('defaultapp', $oldDefaultApps);
- \OC_User::setUserId(null);
- }
-
- public function defaultAppsProvider() {
- return [
- // none specified, default to files
- [
- '',
- 'index.php/apps/files/',
- ['files'],
- ],
- // unexisting or inaccessible app specified, default to files
- [
- 'unexist',
- 'index.php/apps/files/',
- ['files'],
- ],
- // non-standard app
- [
- 'calendar',
- 'index.php/apps/calendar/',
- ['files', 'calendar'],
- ],
- // non-standard app with fallback
- [
- 'contacts,calendar',
- 'index.php/apps/calendar/',
- ['files', 'calendar'],
- ],
- ];
- }
-
- /**
* Test needUpgrade() when the core version is increased
*/
public function testNeedUpgradeCore() {