diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-10-29 09:39:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-29 09:39:22 +0200 |
commit | e48fa1c3370632b5f8a2dcdeeabda217f50b3539 (patch) | |
tree | fdc7176cffe1f6e0a306efe0ccce149584e7f896 /apps/files/tests | |
parent | 035890aeb1b6e540396fd3c81841b60ea6d76f94 (diff) | |
parent | a78f6e95869272b2d5cf34bd3374a9208ae80870 (diff) | |
download | nextcloud-server-e48fa1c3370632b5f8a2dcdeeabda217f50b3539.tar.gz nextcloud-server-e48fa1c3370632b5f8a2dcdeeabda217f50b3539.zip |
Merge pull request #1948 from nextcloud/move_away_lagacy_oc_l10n
Move away from legacy OC_L10N
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' => '', ], |