From 76b5f44f05f3ea9f56707ed0f6c4bff2fa7673e8 Mon Sep 17 00:00:00 2001
From: Daniel Kesselberg <mail@danielkesselberg.de>
Date: Sun, 27 Jan 2019 14:47:19 +0100
Subject: [PATCH] Strict Types, Return Types

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
---
 .drone.yml                                  | 4 ----
 build/integration/run.sh                    | 8 ++++----
 tests/Core/Command/Apps/AppsDisableTest.php | 5 +++--
 tests/Core/Command/Apps/AppsEnableTest.php  | 8 ++++++--
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/.drone.yml b/.drone.yml
index 172a739a04d..b468031fd1c 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -562,7 +562,6 @@ pipeline:
       image: nextcloudci/integration-php7.1:1
       commands:
         - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
-        - ./occ app:enable user_ldap
         - cd build/integration
         - ./run.sh ldap_features/ldap-ocs.feature
       when:
@@ -577,7 +576,6 @@ pipeline:
         - ./occ config:system:set redis timeout --value=0 --type=integer
         - ./occ config:system:set --type string --value "\\OC\\Memcache\\Redis" memcache.local
         - ./occ config:system:set --type string --value "\\OC\\Memcache\\Redis" memcache.distributed
-        - ./occ app:enable user_ldap
         - cd build/integration
         - ./run.sh ldap_features/ldap-openldap.feature
       when:
@@ -592,7 +590,6 @@ pipeline:
           - ./occ config:system:set redis timeout --value=0 --type=integer
           - ./occ config:system:set --type string --value "\\OC\\Memcache\\Redis" memcache.local
           - ./occ config:system:set --type string --value "\\OC\\Memcache\\Redis" memcache.distributed
-          - ./occ app:enable user_ldap
           - cd build/integration
           - ./run.sh ldap_features/openldap-uid-username.feature
         when:
@@ -607,7 +604,6 @@ pipeline:
     - ./occ config:system:set redis timeout --value=0 --type=integer
     - ./occ config:system:set --type string --value "\\OC\\Memcache\\Redis" memcache.local
     - ./occ config:system:set --type string --value "\\OC\\Memcache\\Redis" memcache.distributed
-    - ./occ app:enable user_ldap
     - cd build/integration
     - ./run.sh ldap_features/openldap-numerical-id.feature
     when:
diff --git a/build/integration/run.sh b/build/integration/run.sh
index 56f4ee7b07d..e13a77c27be 100755
--- a/build/integration/run.sh
+++ b/build/integration/run.sh
@@ -48,8 +48,9 @@ export TEST_SERVER_FED_URL="http://localhost:$PORT_FED/ocs/"
 if [ "$INSTALLED" == "true" ]; then
 
     #Enable external storage app
-    $OCC app:enable files_external
-    $OCC app:enable user_ldap
+    $OCC app:install --keep-disabled files_external
+    $OCC app:install --keep-disabled user_ldap
+    $OCC app:enable files_external user_ldap
 
     mkdir -p work/local_storage
     OUTPUT_CREATE_STORAGE=`$OCC files_external:create local_storage local null::null -c datadir=$PWD/work/local_storage`
@@ -71,8 +72,7 @@ if [ "$INSTALLED" == "true" ]; then
     $OCC files_external:delete -y $ID_STORAGE
 
     #Disable external storage app
-    $OCC app:disable files_external
-    $OCC app:disable user_ldap
+    $OCC app:disable files_external user_ldap
 fi
 
 if [ -z $HIDE_OC_LOGS ]; then
diff --git a/tests/Core/Command/Apps/AppsDisableTest.php b/tests/Core/Command/Apps/AppsDisableTest.php
index 1e3c4019f52..d9c43a79c26 100644
--- a/tests/Core/Command/Apps/AppsDisableTest.php
+++ b/tests/Core/Command/Apps/AppsDisableTest.php
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * @copyright Copyright (c) 2019, Daniel Kesselberg (mail@danielkesselberg.de)
  *
@@ -55,7 +56,7 @@ class AppsDisableTest extends TestCase {
 	 * @param $statusCode
 	 * @param $output
 	 */
-	public function testCommandInput($appId, $statusCode, $output) {
+	public function testCommandInput($appId, $statusCode, $output): void {
 		$input = ['app-id' => $appId];
 
 		$this->commandTester->execute($input);
@@ -64,7 +65,7 @@ class AppsDisableTest extends TestCase {
 		$this->assertSame($statusCode, $this->commandTester->getStatusCode());
 	}
 
-	public function dataCommandInput() {
+	public function dataCommandInput(): array {
 		return [
 			[['admin_audit'], 0, 'admin_audit disabled'],
 			[['comments'], 0, 'comments disabled'],
diff --git a/tests/Core/Command/Apps/AppsEnableTest.php b/tests/Core/Command/Apps/AppsEnableTest.php
index e1192d5124d..43f377c70a0 100644
--- a/tests/Core/Command/Apps/AppsEnableTest.php
+++ b/tests/Core/Command/Apps/AppsEnableTest.php
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * @copyright Copyright (c) 2019, Daniel Kesselberg (mail@danielkesselberg.de)
  *
@@ -44,6 +45,9 @@ class AppsEnableTest extends TestCase {
 		);
 
 		$this->commandTester = new CommandTester($command);
+
+		\OC::$server->getAppManager()->disableApp('admin_audit');
+		\OC::$server->getAppManager()->disableApp('comments');
 	}
 
 	/**
@@ -53,7 +57,7 @@ class AppsEnableTest extends TestCase {
 	 * @param $statusCode
 	 * @param $output
 	 */
-	public function testCommandInput($appId, $groups, $statusCode, $output) {
+	public function testCommandInput($appId, $groups, $statusCode, $output): void {
 		$input = ['app-id' => $appId];
 
 		if (is_array($groups)) {
@@ -66,7 +70,7 @@ class AppsEnableTest extends TestCase {
 		$this->assertSame($statusCode, $this->commandTester->getStatusCode());
 	}
 
-	public function dataCommandInput() {
+	public function dataCommandInput(): array {
 		return [
 			[['admin_audit'], null, 0, 'admin_audit enabled'],
 			[['comments'], null, 0, 'comments enabled'],
-- 
GitLab