diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-10-27 20:13:15 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-10-31 17:17:45 +0100 |
commit | 8d83e239f321ef63e08c2c1a6658449c7376c46f (patch) | |
tree | 277603816fcc000d008be6c7ac84c108300b4d9b /tests | |
parent | 32cf661215fb3926789054a3953b465fc2665330 (diff) | |
download | nextcloud-server-8d83e239f321ef63e08c2c1a6658449c7376c46f.tar.gz nextcloud-server-8d83e239f321ef63e08c2c1a6658449c7376c46f.zip |
Fix tests
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Settings/Controller/AppSettingsControllerTest.php | 7 | ||||
-rw-r--r-- | tests/enable_all.php | 2 | ||||
-rw-r--r-- | tests/lib/InstallerTest.php | 6 | ||||
-rw-r--r-- | tests/lib/StreamWrappersTest.php | 2 |
4 files changed, 12 insertions, 5 deletions
diff --git a/tests/Settings/Controller/AppSettingsControllerTest.php b/tests/Settings/Controller/AppSettingsControllerTest.php index fc9d04fcfe7..72fcf1bd7fc 100644 --- a/tests/Settings/Controller/AppSettingsControllerTest.php +++ b/tests/Settings/Controller/AppSettingsControllerTest.php @@ -29,6 +29,7 @@ use OCP\AppFramework\Http\ContentSecurityPolicy; use OCP\AppFramework\Http\JSONResponse; use OCP\AppFramework\Http\TemplateResponse; use OCP\ICacheFactory; +use OCP\L10N\IFactory; use Test\TestCase; use OCP\IRequest; use OCP\IL10N; @@ -61,6 +62,8 @@ class AppSettingsControllerTest extends TestCase { private $categoryFetcher; /** @var AppFetcher|\PHPUnit_Framework_MockObject_MockObject */ private $appFetcher; + /** @var IFactory|\PHPUnit_Framework_MockObject_MockObject */ + private $l10nFactory; public function setUp() { parent::setUp(); @@ -82,6 +85,7 @@ class AppSettingsControllerTest extends TestCase { $this->appManager = $this->createMock(IAppManager::class); $this->categoryFetcher = $this->createMock(CategoryFetcher::class); $this->appFetcher = $this->createMock(AppFetcher::class); + $this->l10nFactory = $this->createMock(IFactory::class); $this->appSettingsController = new AppSettingsController( 'settings', @@ -92,7 +96,8 @@ class AppSettingsControllerTest extends TestCase { $this->navigationManager, $this->appManager, $this->categoryFetcher, - $this->appFetcher + $this->appFetcher, + $this->l10nFactory ); } diff --git a/tests/enable_all.php b/tests/enable_all.php index afea5c89665..655597be7c8 100644 --- a/tests/enable_all.php +++ b/tests/enable_all.php @@ -10,7 +10,7 @@ require_once __DIR__.'/../lib/base.php'; function enableApp($app) { try { - OC_App::enable($app); + (new \OC_App())->enable($app); } catch (Exception $e) { echo $e; } diff --git a/tests/lib/InstallerTest.php b/tests/lib/InstallerTest.php index e1c17b841a2..11c0e2675b1 100644 --- a/tests/lib/InstallerTest.php +++ b/tests/lib/InstallerTest.php @@ -49,7 +49,8 @@ class InstallerTest extends TestCase { ] ); - Installer::installApp($data); + $installer = new Installer(); + $installer->installApp($data); $isInstalled = Installer::isInstalled(self::$appid); $this->assertTrue($isInstalled); @@ -88,7 +89,8 @@ class InstallerTest extends TestCase { ] ); - Installer::installApp($oldData); + $installer = new Installer(); + $installer->installApp($oldData); $oldVersionNumber = \OC_App::getAppVersion(self::$appid); Installer::updateApp($newData); diff --git a/tests/lib/StreamWrappersTest.php b/tests/lib/StreamWrappersTest.php index c0ecb5e738b..eb35fd54454 100644 --- a/tests/lib/StreamWrappersTest.php +++ b/tests/lib/StreamWrappersTest.php @@ -38,7 +38,7 @@ class StreamWrappersTest extends \Test\TestCase { public static function tearDownAfterClass() { if (self::$trashBinStatus) { - \OC_App::enable('files_trashbin'); + (new \OC_App())->enable('files_trashbin'); } } |