From 35cb529df37d33f4c74a5602a3bb9f6bd84fbe40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julius=20H=C3=A4rtl?= <jus@bitgrid.net>
Date: Tue, 17 Apr 2018 20:56:39 +0200
Subject: [PATCH] Fix settings tests
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Julius Härtl <jus@bitgrid.net>
---
 .../unit/Settings/CalDAVSettingsTest.php      |  2 +-
 apps/files/tests/Settings/AdminTest.php       |  2 +-
 tests/lib/Settings/Admin/MailTest.php         |  4 +-
 tests/lib/Settings/Admin/ServerTest.php       | 53 +------------------
 4 files changed, 6 insertions(+), 55 deletions(-)

diff --git a/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php b/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php
index 8ee58107487..36e2aaa9ebb 100644
--- a/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php
+++ b/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php
@@ -49,7 +49,7 @@ class CalDAVSettingsTest extends TestCase {
 	}
 
 	public function testGetSection() {
-		$this->assertEquals('additional', $this->settings->getSection());
+		$this->assertEquals('server', $this->settings->getSection());
 	}
 
 	public function testGetPriority() {
diff --git a/apps/files/tests/Settings/AdminTest.php b/apps/files/tests/Settings/AdminTest.php
index 071cef7d75f..027a37d7b2f 100644
--- a/apps/files/tests/Settings/AdminTest.php
+++ b/apps/files/tests/Settings/AdminTest.php
@@ -75,7 +75,7 @@ class AdminTest extends TestCase {
 	}
 
 	public function testGetSection() {
-		$this->assertSame('additional', $this->admin->getSection());
+		$this->assertSame('server', $this->admin->getSection());
 	}
 
 	public function testGetPriority() {
diff --git a/tests/lib/Settings/Admin/MailTest.php b/tests/lib/Settings/Admin/MailTest.php
index 445aa942059..04c0e7fa92e 100644
--- a/tests/lib/Settings/Admin/MailTest.php
+++ b/tests/lib/Settings/Admin/MailTest.php
@@ -119,10 +119,10 @@ class MailTest extends TestCase {
 	}
 
 	public function testGetSection() {
-		$this->assertSame('additional', $this->admin->getSection());
+		$this->assertSame('server', $this->admin->getSection());
 	}
 
 	public function testGetPriority() {
-		$this->assertSame(0, $this->admin->getPriority());
+		$this->assertSame(10, $this->admin->getPriority());
 	}
 }
diff --git a/tests/lib/Settings/Admin/ServerTest.php b/tests/lib/Settings/Admin/ServerTest.php
index b8317540117..a121abc3df2 100644
--- a/tests/lib/Settings/Admin/ServerTest.php
+++ b/tests/lib/Settings/Admin/ServerTest.php
@@ -65,74 +65,25 @@ class ServerTest extends TestCase {
 	}
 
 	public function testGetForm() {
-		$this->dbConnection
-			->expects($this->once())
-			->method('getDatabasePlatform')
-			->willReturn(new SqlitePlatform());
 		$this->config
 			->expects($this->at(0))
-			->method('getSystemValue')
-			->with('overwrite.cli.url', '')
-			->willReturn(true);
-		$this->config
-			->expects($this->at(2))
 			->method('getAppValue')
 			->with('core', 'backgroundjobs_mode', 'ajax')
 			->willReturn('ajax');
 		$this->config
-			->expects($this->at(3))
+			->expects($this->at(1))
 			->method('getAppValue')
 			->with('core', 'lastcron', false)
 			->willReturn(false);
 		$this->config
-			->expects($this->at(4))
+			->expects($this->at(2))
 			->method('getAppValue')
 			->with('core', 'cronErrors')
 			->willReturn('');
-		$this->config
-			->expects($this->at(1))
-			->method('getSystemValue')
-			->with('check_for_working_wellknown_setup', true)
-			->willReturn(true);
-		$this->l10n
-			->expects($this->at(0))
-			->method('t')
-			->with('APCu')
-			->willReturn('APCu');
-		$this->l10n
-			->expects($this->at(1))
-			->method('t')
-			->with('Redis')
-			->willReturn('Redis');
-		$outdatedCaches = [];
-		$caches = [
-			'apcu'	=> ['name' => 'APCu', 'version' => '4.0.6'],
-			'redis'	=> ['name' => 'Redis', 'version' => '2.2.5'],
-		];
-		foreach ($caches as $php_module => $data) {
-			$isOutdated = extension_loaded($php_module) && version_compare(phpversion($php_module), $data['version'], '<');
-			if ($isOutdated) {
-				$outdatedCaches[$php_module] = $data;
-			}
-		}
-		$envPath = getenv('PATH');
 		$expected = new TemplateResponse(
 			'settings',
 			'settings/admin/server',
 			[
-				// Diagnosis
-				'readOnlyConfigEnabled'            => \OC_Helper::isReadOnlyConfigEnabled(),
-				'isLocaleWorking'                  => \OC_Util::isSetLocaleWorking(),
-				'isAnnotationsWorking'             => \OC_Util::isAnnotationsWorking(),
-				'checkForWorkingWellKnownSetup'    => true,
-				'has_fileinfo'                     => \OC_Util::fileInfoLoaded(),
-				'invalidTransactionIsolationLevel' => false,
-				'getenvServerNotWorking'           => empty($envPath),
-				'OutdatedCacheWarning'             => $outdatedCaches,
-				'fileLockingType'                  => 'cache',
-				'suggestedOverwriteCliUrl'         => '',
-
-				// Background jobs
 				'backgroundjobs_mode' => 'ajax',
 				'lastcron'            => false,
 				'cronErrors'		  => '',
-- 
GitLab