diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/data/app/expected-info.json | 3 | ||||
-rw-r--r-- | tests/data/app/valid-info.xml | 1 | ||||
-rw-r--r-- | tests/lib/app/dependencyanalyzer.php | 28 |
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 |