diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-12-12 12:34:53 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-12-12 12:34:53 +0100 |
commit | dcb88e395b63ac0747b1eb1af5cf3d3e65173efb (patch) | |
tree | 1b3df0100bec4c585b4f2306f4b27ea3dc3673d0 /tests | |
parent | d94c1731d7887fa15156cec94916d71ee763d9d0 (diff) | |
download | nextcloud-server-dcb88e395b63ac0747b1eb1af5cf3d3e65173efb.tar.gz nextcloud-server-dcb88e395b63ac0747b1eb1af5cf3d3e65173efb.zip |
rework api of DependencyAnalyzer
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/app/dependencyanalyzer.php | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/tests/lib/app/dependencyanalyzer.php b/tests/lib/app/dependencyanalyzer.php index 8443dc5d319..a79995b78b3 100644 --- a/tests/lib/app/dependencyanalyzer.php +++ b/tests/lib/app/dependencyanalyzer.php @@ -15,16 +15,15 @@ use OCP\IL10N; class DependencyAnalyzer extends \PHPUnit_Framework_TestCase { - /** - * @var Platform - */ + /** @var Platform */ private $platformMock; - /** - * @var IL10N - */ + /** @var IL10N */ private $l10nMock; + /** @var \OC\App\DependencyAnalyzer */ + private $analyser; + public function setUp() { $this->platformMock = $this->getMockBuilder('\OC\App\Platform') ->disableOriginalConstructor() @@ -63,6 +62,8 @@ class DependencyAnalyzer extends \PHPUnit_Framework_TestCase { ->will($this->returnCallback(function($text, $parameters = array()) { return vsprintf($text, $parameters); })); + + $this->analyser = new \OC\App\DependencyAnalyzer($this->platformMock, $this->l10nMock); } /** @@ -80,8 +81,7 @@ class DependencyAnalyzer extends \PHPUnit_Framework_TestCase { if (!is_null($maxVersion)) { $app['dependencies']['php']['@attributes']['max-version'] = $maxVersion; } - $analyser = new \OC\App\DependencyAnalyzer($app, $this->platformMock, $this->l10nMock); - $missing = $analyser->analyze(); + $missing = $this->analyser->analyze($app); $this->assertTrue(is_array($missing)); $this->assertEquals($expectedMissing, $missing); @@ -98,8 +98,7 @@ class DependencyAnalyzer extends \PHPUnit_Framework_TestCase { if (!is_null($databases)) { $app['dependencies']['database'] = $databases; } - $analyser = new \OC\App\DependencyAnalyzer($app, $this->platformMock, $this->l10nMock); - $missing = $analyser->analyze(); + $missing = $this->analyser->analyze($app); $this->assertTrue(is_array($missing)); $this->assertEquals($expectedMissing, $missing); @@ -116,8 +115,7 @@ class DependencyAnalyzer extends \PHPUnit_Framework_TestCase { if (!is_null($commands)) { $app['dependencies']['command'] = $commands; } - $analyser = new \OC\App\DependencyAnalyzer($app, $this->platformMock, $this->l10nMock); - $missing = $analyser->analyze(); + $missing = $this->analyser->analyze($app); $this->assertTrue(is_array($missing)); $this->assertEquals($expectedMissing, $missing); @@ -137,8 +135,7 @@ class DependencyAnalyzer extends \PHPUnit_Framework_TestCase { $app['dependencies']['lib'] = $libs; } - $analyser = new \OC\App\DependencyAnalyzer($app, $this->platformMock, $this->l10nMock); - $missing = $analyser->analyze(); + $missing = $this->analyser->analyze($app); $this->assertTrue(is_array($missing)); $this->assertEquals($expectedMissing, $missing); @@ -157,8 +154,7 @@ class DependencyAnalyzer extends \PHPUnit_Framework_TestCase { $app['dependencies']['os'] = $oss; } - $analyser = new \OC\App\DependencyAnalyzer($app, $this->platformMock, $this->l10nMock); - $missing = $analyser->analyze(); + $missing = $this->analyser->analyze($app); $this->assertTrue(is_array($missing)); $this->assertEquals($expectedMissing, $missing); @@ -177,8 +173,7 @@ class DependencyAnalyzer extends \PHPUnit_Framework_TestCase { $app['dependencies']['owncloud'] = $oc; } - $analyser = new \OC\App\DependencyAnalyzer($app, $this->platformMock, $this->l10nMock); - $missing = $analyser->analyze(); + $missing = $this->analyser->analyze($app); $this->assertTrue(is_array($missing)); $this->assertEquals($expectedMissing, $missing); |