summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2017-04-11 09:22:46 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2017-04-11 09:22:46 +0200
commita309d7c2802f654c5c13b76672620f438cffb9be (patch)
tree3dcd093fecbfa5a388ef6c4147688c69362c2117
parent07f1bb1013f1427d14d4b4c3b93a7e4fce4a261f (diff)
Use absolute path for icon url
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
-rw-r--r--lib/ContactsMenu/Providers/DetailsProvider.php3
-rw-r--r--tests/unit/ContactsMenu/Provider/DetailsProviderTest.php25
2 files changed, 18 insertions, 10 deletions
diff --git a/lib/ContactsMenu/Providers/DetailsProvider.php b/lib/ContactsMenu/Providers/DetailsProvider.php
index 03231720..a2223555 100644
--- a/lib/ContactsMenu/Providers/DetailsProvider.php
+++ b/lib/ContactsMenu/Providers/DetailsProvider.php
@@ -64,8 +64,9 @@ class DetailsProvider implements IProvider {
// TODO: unique contact URL to the contacts app
// TODO: l10n
+ $iconUrl = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/info.svg'));
$contactsUrl = $this->urlGenerator->getAbsoluteURL('/index.php/apps/contacts');
- $action = $this->actionFactory->newLinkAction('icon-info', 'Details', $contactsUrl);
+ $action = $this->actionFactory->newLinkAction($iconUrl, 'Details', $contactsUrl);
$action->setPriority(0);
$entry->addAction($action);
}
diff --git a/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php b/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php
index 85f34cb4..26f00575 100644
--- a/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php
+++ b/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php
@@ -58,16 +58,23 @@ class DetailsProviderTest extends PHPUnit_Framework_TestCase {
$entry->expects($this->exactly(2))
->method('getProperty')
->will($this->returnValueMap([
- ['UID', 'e3a71614-c602-4eb5-9994-47eec551542b'],
- ['isLocalSystemBook', null]
- ]));
+ ['UID', 'e3a71614-c602-4eb5-9994-47eec551542b'],
+ ['isLocalSystemBook', null]
+ ]));
$this->urlGenerator->expects($this->once())
+ ->method('imagePath')
+ ->with('core', 'actions/info.svg')
+ ->willReturn('core/img/actions/info.svg');
+ $iconUrl = 'https://example.com/core/img/actions/info.svg';
+ $this->urlGenerator->expects($this->exactly(2))
->method('getAbsoluteURL')
- ->with('/index.php/apps/contacts')
- ->willReturn('cloud.example.com/index.php/apps/contacts');
+ ->will($this->returnValueMap([
+ ['/index.php/apps/contacts', 'cloud.example.com/index.php/apps/contacts'],
+ ['core/img/actions/info.svg', $iconUrl],
+ ]));
$this->actionFactory->expects($this->once())
->method('newLinkAction')
- ->with($this->equalTo('icon-info'), $this->equalTo('Details'), $this->equalTo('cloud.example.com/index.php/apps/contacts'))
+ ->with($this->equalTo($iconUrl), $this->equalTo('Details'), $this->equalTo('cloud.example.com/index.php/apps/contacts'))
->willReturn($action);
$action->expects($this->once())
->method('setPriority')
@@ -96,9 +103,9 @@ class DetailsProviderTest extends PHPUnit_Framework_TestCase {
$entry->expects($this->exactly(2))
->method('getProperty')
->will($this->returnValueMap([
- ['UID', 1234],
- ['isLocalSystemBook', true]
- ]));
+ ['UID', 1234],
+ ['isLocalSystemBook', true]
+ ]));
$entry->expects($this->never())
->method('addAction');