summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2017-04-24 11:35:18 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2017-04-24 11:35:18 +0200
commit04f992654203050d28bf6f41ab8ac2ea1019d6b0 (patch)
treee92172327374d5b8b657b73877269e97d4a1c4e0 /tests
parent026d509336775b9d6bf4c1d10849f03a2e9e5692 (diff)
Translate details action
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/ContactsMenu/Provider/DetailsProviderTest.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php b/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php
index 8ee73d87..d1945c3a 100644
--- a/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php
+++ b/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php
@@ -28,6 +28,7 @@ use OCA\Contacts\ContactsMenu\Providers\DetailsProvider;
use OCP\Contacts\ContactsMenu\IActionFactory;
use OCP\Contacts\ContactsMenu\IEntry;
use OCP\Contacts\ContactsMenu\ILinkAction;
+use OCP\IL10N;
use OCP\IURLGenerator;
use PHPUnit_Framework_MockObject_MockObject;
use PHPUnit_Framework_TestCase;
@@ -40,6 +41,9 @@ class DetailsProviderTest extends PHPUnit_Framework_TestCase {
/** @var IActionFactory|PHPUnit_Framework_MockObject_MockObject */
private $actionFactory;
+ /** @var IL10n|PHPUnit_Framework_MockObject_MockObject */
+ private $l10n;
+
/** @var DetailsProvider */
private $provider;
@@ -48,7 +52,8 @@ class DetailsProviderTest extends PHPUnit_Framework_TestCase {
$this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->actionFactory = $this->createMock(IActionFactory::class);
- $this->provider = new DetailsProvider($this->urlGenerator, $this->actionFactory);
+ $this->l10n = $this->createMock(IL10N::class);
+ $this->provider = new DetailsProvider($this->urlGenerator, $this->actionFactory, $this->l10n);
}
public function testProcess() {
@@ -72,6 +77,10 @@ class DetailsProviderTest extends PHPUnit_Framework_TestCase {
['/index.php/apps/contacts#/contact/e3a71614-c602-4eb5-9994-47eec551542b', 'cloud.example.com/index.php/apps/contacts#/contact/e3a71614-c602-4eb5-9994-47eec551542b'],
['core/img/actions/info.svg', $iconUrl],
]));
+ $this->l10n->expects($this->once())
+ ->method('t')
+ ->with('Details')
+ ->willReturnArgument(0);
$this->actionFactory->expects($this->once())
->method('newLinkAction')
->with($this->equalTo($iconUrl), $this->equalTo('Details'), $this->equalTo('cloud.example.com/index.php/apps/contacts#/contact/e3a71614-c602-4eb5-9994-47eec551542b'))