Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/updater.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-08-08 22:21:29 +0300
committerMorris Jobke <hey@morrisjobke.de>2017-08-09 11:24:14 +0300
commite885c81e28c9f745ec54175bc1ae0aed69bdf979 (patch)
tree257e2545528d61226cc7e91d1abca63dde110cc1
parent2c042721b866cd4ca6ce58f1e00886530a6df516 (diff)
Add integration tests for apps directory
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
-rw-r--r--tests/features/bootstrap/FeatureContext.php34
-rw-r--r--tests/features/cli.feature22
2 files changed, 56 insertions, 0 deletions
diff --git a/tests/features/bootstrap/FeatureContext.php b/tests/features/bootstrap/FeatureContext.php
index 7d8ef5a..2511f23 100644
--- a/tests/features/bootstrap/FeatureContext.php
+++ b/tests/features/bootstrap/FeatureContext.php
@@ -423,4 +423,38 @@ jFSE6+KKI+HAE132eaXY5A==',
$content = preg_replace("!'version'\s*=>\s*'(\d+\.\d+\.\d+)\.\d+!", "'version' => '$1", $content);
file_put_contents($configFile, $content);
}
+
+ /**
+ * @Given there is a folder called :name
+ */
+ public function thereIsAFolderCalled($name)
+ {
+ mkdir($this->serverDir . 'nextcloud/' . $name);
+ }
+
+ /**
+ * @Given there is a config for a secondary apps directory called :name
+ */
+ public function thereIsAConfigForASecondaryAppsDirectoryCalled($name)
+ {
+ $configFile = $this->serverDir . 'nextcloud/config/config.php';
+ $content = file_get_contents($configFile);
+ $appsPaths = <<<EOF
+ 'apps_paths' => [
+ [
+ 'path'=> dirname(__DIR__) . '/apps',
+ 'url' => '/apps',
+ 'writable' => true,
+ ],
+ [
+ 'path'=> dirname(__DIR__) . '/%s',
+ 'url' => '/%s',
+ 'writable' => true,
+ ],
+ ],
+EOF;
+ $appsPaths = sprintf($appsPaths, $name, $name);
+ $content = preg_replace("!\);!", $appsPaths . ');', $content);
+ file_put_contents($configFile, $content);
+ }
}
diff --git a/tests/features/cli.feature b/tests/features/cli.feature
index 99af2f1..d399547 100644
--- a/tests/features/cli.feature
+++ b/tests/features/cli.feature
@@ -69,3 +69,25 @@ Feature: CLI updater
Then the installed version should be 10.0.0
And maintenance mode should be off
And upgrade is not required
+
+ Scenario: Update is available and apps2 folder is there and configured - 10.0.0 to 10.0.1
+ Given the current installed version is 10.0.0
+ And there is an update to version 10.0.1 available
+ And there is a folder called "apps2"
+ And there is a config for a secondary apps directory called "apps2"
+ When the CLI updater is run successfully
+ Then the installed version should be 10.0.1
+ And maintenance mode should be off
+ And upgrade is not required
+
+ Scenario: Update is available and apps2 folder is there and not configured - 10.0.0 to 10.0.1
+ Given the current installed version is 10.0.0
+ And there is an update to version 10.0.1 available
+ And there is a folder called "apps2"
+ When the CLI updater is run
+ Then the return code should not be 0
+ And the output should contain "The following extra files have been found"
+ And the output should contain "apps2"
+ And the installed version should be 10.0.0
+ And maintenance mode should be off
+ And upgrade is not required