diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-10-28 22:08:32 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-10-28 22:16:28 +0200 |
commit | 83e7cfd13a6592d72c29eabdfce61c91f3d49630 (patch) | |
tree | befb9165faf3426641ed3c286a0f4c45c3d769f9 /apps/files/tests | |
parent | 740659a04c28f8b2bfd9265d459dd3bca202300f (diff) | |
download | nextcloud-server-83e7cfd13a6592d72c29eabdfce61c91f3d49630.tar.gz nextcloud-server-83e7cfd13a6592d72c29eabdfce61c91f3d49630.zip |
Fix more tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files/tests')
-rw-r--r-- | apps/files/tests/ActivityTest.php | 14 | ||||
-rw-r--r-- | apps/files/tests/Controller/ViewControllerTest.php | 14 |
2 files changed, 13 insertions, 15 deletions
diff --git a/apps/files/tests/ActivityTest.php b/apps/files/tests/ActivityTest.php index e6199013e81..65e914c1a54 100644 --- a/apps/files/tests/ActivityTest.php +++ b/apps/files/tests/ActivityTest.php @@ -24,6 +24,8 @@ namespace OCA\Files\Tests; use OCA\Files\Activity; +use OCP\IL10N; +use OCP\L10N\IFactory; use Test\TestCase; /** @@ -77,12 +79,8 @@ class ActivityTest extends TestCase { $this->config ); - $this->l10nFactory = $this->getMockBuilder('OCP\L10N\IFactory') - ->disableOriginalConstructor() - ->getMock(); - $deL10n = $this->getMockBuilder('OC_L10N') - ->disableOriginalConstructor() - ->getMock(); + $this->l10nFactory = $this->createMock(IFactory::class); + $deL10n = $this->createMock(IL10N::class); $deL10n->expects($this->any()) ->method('t') ->willReturnCallback(function ($argument) { @@ -92,8 +90,8 @@ class ActivityTest extends TestCase { $this->l10nFactory->expects($this->any()) ->method('get') ->willReturnMap([ - ['files', null, new \OC_L10N('files', 'en')], - ['files', 'en', new \OC_L10N('files', 'en')], + ['files', null, \OC::$server->getL10N('files', 'en')], + ['files', 'en', \OC::$server->getL10N('files', 'en')], ['files', 'de', $deL10n], ]); diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php index b4b4bfa92fc..179aaa373b3 100644 --- a/apps/files/tests/Controller/ViewControllerTest.php +++ b/apps/files/tests/Controller/ViewControllerTest.php @@ -137,7 +137,7 @@ class ViewControllerTest extends TestCase { 'appname' => 'files', 'script' => 'list.php', 'order' => 0, - 'name' => (string)new \OC_L10N_String(new \OC_L10N('files'), 'All files', []), + 'name' => \OC::$server->getL10N('files')->t('All files'), 'active' => false, 'icon' => '', ], @@ -146,7 +146,7 @@ class ViewControllerTest extends TestCase { 'appname' => 'files', 'script' => 'recentlist.php', 'order' => 2, - 'name' => (string)new \OC_L10N_String(new \OC_L10N('files'), 'Recent', []), + 'name' => \OC::$server->getL10N('files')->t('Recent'), 'active' => false, 'icon' => '', ], @@ -164,7 +164,7 @@ class ViewControllerTest extends TestCase { 'appname' => 'files_sharing', 'script' => 'list.php', 'order' => 10, - 'name' => (string)new \OC_L10N_String(new \OC_L10N('files_sharing'), 'Shared with you', []), + 'name' => \OC::$server->getL10N('files_sharing')->t('Shared with you'), 'active' => false, 'icon' => '', ], @@ -173,7 +173,7 @@ class ViewControllerTest extends TestCase { 'appname' => 'files_sharing', 'script' => 'list.php', 'order' => 15, - 'name' => (string)new \OC_L10N_String(new \OC_L10N('files_sharing'), 'Shared with others', []), + 'name' => \OC::$server->getL10N('files_sharing')->t('Shared with others'), 'active' => false, 'icon' => '', ], @@ -182,7 +182,7 @@ class ViewControllerTest extends TestCase { 'appname' => 'files_sharing', 'script' => 'list.php', 'order' => 20, - 'name' => (string)new \OC_L10N_String(new \OC_L10N('files_sharing'), 'Shared by link', []), + 'name' => \OC::$server->getL10N('files_sharing')->t('Shared by link', []), 'active' => false, 'icon' => '', ], @@ -191,7 +191,7 @@ class ViewControllerTest extends TestCase { 'appname' => 'systemtags', 'script' => 'list.php', 'order' => 25, - 'name' => (string)new \OC_L10N_String(new \OC_L10N('systemtags'), 'Tags', []), + 'name' => \OC::$server->getL10N('systemtags')->t('Tags'), 'active' => false, 'icon' => '', ], @@ -200,7 +200,7 @@ class ViewControllerTest extends TestCase { 'appname' => 'files_trashbin', 'script' => 'list.php', 'order' => 50, - 'name' => (string)new \OC_L10N_String(new \OC_L10N('files_trashbin'), 'Deleted files', []), + 'name' => \OC::$server->getL10N('files_trashbin')->t('Deleted files'), 'active' => false, 'icon' => '', ], |