aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-12-05 14:51:41 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-12-11 12:02:12 +0100
commitee46548f57310b45ce723fd03ec29bfb686f8bc2 (patch)
tree8c9f08b00e1b9cd9da567439a9f90993f6d3917a /tests
parent770f9876595a3cebd4b911a237ec1e681bc506be (diff)
downloadnextcloud-server-ee46548f57310b45ce723fd03ec29bfb686f8bc2.tar.gz
nextcloud-server-ee46548f57310b45ce723fd03ec29bfb686f8bc2.zip
adding dependencies for supported platforms
Diffstat (limited to 'tests')
-rw-r--r--tests/data/app/expected-info.json3
-rw-r--r--tests/data/app/valid-info.xml1
-rw-r--r--tests/lib/app/dependencyanalyzer.php28
3 files changed, 31 insertions, 1 deletions
diff --git a/tests/data/app/expected-info.json b/tests/data/app/expected-info.json
index a425622998b..b899df7a8d6 100644
--- a/tests/data/app/expected-info.json
+++ b/tests/data/app/expected-info.json
@@ -59,6 +59,7 @@
"@value": "intl"
},
"curl"
- ]
+ ],
+ "os": "Linux"
}
}
diff --git a/tests/data/app/valid-info.xml b/tests/data/app/valid-info.xml
index 0ea15b63a4b..42f4e3edb7f 100644
--- a/tests/data/app/valid-info.xml
+++ b/tests/data/app/valid-info.xml
@@ -28,5 +28,6 @@
<lib min-version="1.2">xml</lib>
<lib max-version="2.0">intl</lib>
<lib>curl</lib>
+ <os>Linux</os>
</dependencies>
</info>
diff --git a/tests/lib/app/dependencyanalyzer.php b/tests/lib/app/dependencyanalyzer.php
index 872d5cfb2c5..1cd24193ea6 100644
--- a/tests/lib/app/dependencyanalyzer.php
+++ b/tests/lib/app/dependencyanalyzer.php
@@ -141,6 +141,34 @@ class DependencyAnalyzer extends \PHPUnit_Framework_TestCase {
$this->assertEquals($expectedMissing, $missing);
}
+ /**
+ * @dataProvider providesOS
+ * @param $expectedMissing
+ * @param $oss
+ */
+ function testOS($expectedMissing, $oss) {
+ $app = array(
+ 'dependencies' => array()
+ );
+ if (!is_null($oss)) {
+ $app['dependencies']['os'] = $oss;
+ }
+
+ $analyser = new \OC\App\DependencyAnalyzer($app, $this->platformMock, $this->l10nMock);
+ $missing = $analyser->analyze();
+
+ $this->assertTrue(is_array($missing));
+ $this->assertEquals($expectedMissing, $missing);
+ }
+
+ function providesOS() {
+ return array(
+ array(array(), null),
+ array(array(), array()),
+ array(array('Following platforms are supported: WINNT'), array('WINNT'))
+ );
+ }
+
function providesLibs() {
return array(
// we expect curl to exist