summaryrefslogtreecommitdiffstats
path: root/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/ContactsMenu/Provider/DetailsProviderTest.php')
-rw-r--r--tests/unit/ContactsMenu/Provider/DetailsProviderTest.php113
1 files changed, 56 insertions, 57 deletions
diff --git a/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php b/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php
index a6d33cb0..41e73050 100644
--- a/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php
+++ b/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php
@@ -105,69 +105,69 @@ class DetailsProviderTest extends Base {
$this->config->expects($this->at(0))
- ->method('getSystemValue')
- ->with('version', '0.0.0')
- ->willReturn($version);
+ ->method('getSystemValue')
+ ->with('version', '0.0.0')
+ ->willReturn($version);
$this->config->expects($this->at(1))
- ->method('getSystemValue')
- ->with('htaccess.IgnoreFrontController', false)
- ->willReturn($frontControllerActive);
+ ->method('getSystemValue')
+ ->with('htaccess.IgnoreFrontController', false)
+ ->willReturn($frontControllerActive);
$entry->expects($this->exactly(3))
- ->method('getProperty')
- ->will($this->returnValueMap([
- ['UID', $uid],
- ['isLocalSystemBook', null],
- ['addressbook-key', 1]
- ]));
+ ->method('getProperty')
+ ->will($this->returnValueMap([
+ ['UID', $uid],
+ ['isLocalSystemBook', null],
+ ['addressbook-key', 1]
+ ]));
$addressbook->expects($this->once())
- ->method('getKey')
- ->willReturn(1);
+ ->method('getKey')
+ ->willReturn(1);
$addressbook->expects($this->once())
- ->method('getUri')
- ->willReturn($abUri);
+ ->method('getUri')
+ ->willReturn($abUri);
$this->manager->expects($this->once())
- ->method('getUserAddressbooks')
- ->willReturn([1 => $addressbook]);
+ ->method('getUserAddressbooks')
+ ->willReturn([1 => $addressbook]);
// Action icon
$this->urlGenerator->expects($this->once())
- ->method('imagePath')
- ->with('core', 'actions/info.svg')
- ->willReturn($iconUrl);
+ ->method('imagePath')
+ ->with('core', 'actions/info.svg')
+ ->willReturn($iconUrl);
// Action icon and contact absolute urls
$this->urlGenerator->expects($this->exactly(2))
- ->method('getAbsoluteURL')
- ->will($this->returnValueMap([
- [$iconUrl, "$domain/$iconUrl"],
- ["$index/apps/contacts/$defaultGroup/$uid~$abUri", "$domain$index/apps/contacts/$defaultGroup/$uid~$abUri"]
- ]));
+ ->method('getAbsoluteURL')
+ ->will($this->returnValueMap([
+ [$iconUrl, "$domain/$iconUrl"],
+ ["$index/apps/contacts/$defaultGroup/$uid~$abUri", "$domain$index/apps/contacts/$defaultGroup/$uid~$abUri"]
+ ]));
// Translations
$this->l10n->expects($this->at(0))
- ->method('t')
- ->with($defaultGroup)
- ->willReturn($defaultGroup);
+ ->method('t')
+ ->with($defaultGroup)
+ ->willReturn($defaultGroup);
$this->l10n->expects($this->at(1))
- ->method('t')
- ->with('Details')
+ ->method('t')
+ ->with('Details')
->willReturnArgument(0);
$this->actionFactory->expects($this->once())
- ->method('newLinkAction')
- ->with($this->equalTo("$domain/$iconUrl"), $this->equalTo('Details'), $this->equalTo($resultUri))
- ->willReturn($action);
+ ->method('newLinkAction')
+ ->with($this->equalTo("$domain/$iconUrl"), $this->equalTo('Details'), $this->equalTo($resultUri))
+ ->willReturn($action);
$action->expects($this->once())
- ->method('setPriority')
- ->with($this->equalTo(0));
+ ->method('setPriority')
+ ->with($this->equalTo(0));
$entry->expects($this->once())
- ->method('addAction')
- ->with($action);
+ ->method('addAction')
+ ->with($action);
$this->provider->process($entry);
}
@@ -178,17 +178,17 @@ class DetailsProviderTest extends Base {
*/
public function testProcessNC15() {
$this->config->expects($this->once())
- ->method('getSystemValue')
- ->with('version', '0.0.0')
- ->willReturn('15.0.0.0');
+ ->method('getSystemValue')
+ ->with('version', '0.0.0')
+ ->willReturn('15.0.0.0');
$entry = $this->createMock(IEntry::class);
$entry->expects($this->exactly(2))
- ->method('getProperty')
- ->will($this->returnValueMap([
- ['UID', 'e3a71614-c602-4eb5-9994-47eec551542b'],
- ['isLocalSystemBook', null]
- ]));
+ ->method('getProperty')
+ ->will($this->returnValueMap([
+ ['UID', 'e3a71614-c602-4eb5-9994-47eec551542b'],
+ ['isLocalSystemBook', null]
+ ]));
$this->assertNull($this->provider->process($entry));
}
@@ -196,11 +196,11 @@ class DetailsProviderTest extends Base {
public function testProcessNoUID() {
$entry = $this->createMock(IEntry::class);
$entry->expects($this->once())
- ->method('getProperty')
- ->with($this->equalTo('UID'))
- ->willReturn(null);
+ ->method('getProperty')
+ ->with($this->equalTo('UID'))
+ ->willReturn(null);
$entry->expects($this->never())
- ->method('addAction');
+ ->method('addAction');
$this->provider->process($entry);
}
@@ -208,15 +208,14 @@ class DetailsProviderTest extends Base {
public function testProcessSystemContact() {
$entry = $this->createMock(IEntry::class);
$entry->expects($this->exactly(2))
- ->method('getProperty')
- ->will($this->returnValueMap([
- ['UID', 1234],
- ['isLocalSystemBook', true]
- ]));
+ ->method('getProperty')
+ ->will($this->returnValueMap([
+ ['UID', 1234],
+ ['isLocalSystemBook', true]
+ ]));
$entry->expects($this->never())
- ->method('addAction');
+ ->method('addAction');
$this->provider->process($entry);
}
-
}