summaryrefslogtreecommitdiffstats
path: root/tests/lib/Contacts
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2017-04-11 09:09:45 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2017-04-25 20:47:17 +0200
commit2c2e1f7988df795d8f85a3003f84fa646c701380 (patch)
tree79c6ccf13e2efd5228f5d1971f171c9de42ef23d /tests/lib/Contacts
parentb8c2a8ae36235780675103286a04f8b6af50b4aa (diff)
downloadnextcloud-server-2c2e1f7988df795d8f85a3003f84fa646c701380.tar.gz
nextcloud-server-2c2e1f7988df795d8f85a3003f84fa646c701380.zip
Use absolute URI for action icons
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/lib/Contacts')
-rw-r--r--tests/lib/Contacts/ContactsMenu/Providers/EMailproviderTest.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/lib/Contacts/ContactsMenu/Providers/EMailproviderTest.php b/tests/lib/Contacts/ContactsMenu/Providers/EMailproviderTest.php
index af7b21a6485..2d82fa5d68e 100644
--- a/tests/lib/Contacts/ContactsMenu/Providers/EMailproviderTest.php
+++ b/tests/lib/Contacts/ContactsMenu/Providers/EMailproviderTest.php
@@ -28,6 +28,7 @@ use OC\Contacts\ContactsMenu\Providers\EMailProvider;
use OCP\Contacts\ContactsMenu\IActionFactory;
use OCP\Contacts\ContactsMenu\IEntry;
use OCP\Contacts\ContactsMenu\ILinkAction;
+use OCP\IURLGenerator;
use PHPUnit_Framework_MockObject_MockObject;
use Test\TestCase;
@@ -36,6 +37,9 @@ class EMailproviderTest extends TestCase {
/** @var IActionFactory|PHPUnit_Framework_MockObject_MockObject */
private $actionFactory;
+ /** @var IURLGenerator|PHPUnit_Framework_MockObject_MockObject */
+ private $urlGenerator;
+
/** @var EMailProvider */
private $provider;
@@ -43,13 +47,22 @@ class EMailproviderTest extends TestCase {
parent::setUp();
$this->actionFactory = $this->createMock(IActionFactory::class);
- $this->provider = new EMailProvider($this->actionFactory);
+ $this->urlGenerator = $this->createMock(IURLGenerator::class);
+
+ $this->provider = new EMailProvider($this->actionFactory, $this->urlGenerator);
}
public function testProcess() {
$entry = $this->createMock(IEntry::class);
$action = $this->createMock(ILinkAction::class);
-
+ $iconUrl = 'https://example.com/img/actions/icon.svg';
+ $this->urlGenerator->expects($this->once())
+ ->method('imagePath')
+ ->willReturn('img/actions/icon.svg');
+ $this->urlGenerator->expects($this->once())
+ ->method('getAbsoluteURL')
+ ->with('img/actions/icon.svg')
+ ->willReturn($iconUrl);
$entry->expects($this->once())
->method('getEMailAddresses')
->willReturn([
@@ -57,7 +70,7 @@ class EMailproviderTest extends TestCase {
]);
$this->actionFactory->expects($this->once())
->method('newEMailAction')
- ->with($this->equalTo('icon-mail'), $this->equalTo('Mail'), $this->equalTo('user@example.com'))
+ ->with($this->equalTo($iconUrl), $this->equalTo('user@example.com'), $this->equalTo('user@example.com'))
->willReturn($action);
$entry->expects($this->once())
->method('addAction')