summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-05-02 17:02:16 +0200
committerGitHub <noreply@github.com>2017-05-02 17:02:16 +0200
commit121cb4bcfcc696006036f93bdc1b946d8e4e3e95 (patch)
tree938e09b4492e28b6c7de22efb8b6674abf66299f /tests
parent68a1902586ab52bfddee94dd6adb276ff2df34a2 (diff)
parentb13c741cb3471f4f2df579b81e0bb5ebe56fff95 (diff)
downloadnextcloud-server-121cb4bcfcc696006036f93bdc1b946d8e4e3e95.tar.gz
nextcloud-server-121cb4bcfcc696006036f93bdc1b946d8e4e3e95.zip
Merge pull request #4659 from nextcloud/fix/ignore-empty-email-contacts-menu
Do not show an email action for contacts with emtpy email addresses
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Contacts/ContactsMenu/Providers/EMailproviderTest.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/lib/Contacts/ContactsMenu/Providers/EMailproviderTest.php b/tests/lib/Contacts/ContactsMenu/Providers/EMailproviderTest.php
index 2d82fa5d68e..353c8d6f58f 100644
--- a/tests/lib/Contacts/ContactsMenu/Providers/EMailproviderTest.php
+++ b/tests/lib/Contacts/ContactsMenu/Providers/EMailproviderTest.php
@@ -79,4 +79,28 @@ class EMailproviderTest extends TestCase {
$this->provider->process($entry);
}
+ public function testProcessEmptyAddress() {
+ $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([
+ '',
+ ]);
+ $this->actionFactory->expects($this->never())
+ ->method('newEMailAction');
+ $entry->expects($this->never())
+ ->method('addAction');
+
+ $this->provider->process($entry);
+ }
+
}