summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/lib/ContactsManagerTest.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/lib/ContactsManagerTest.php b/tests/lib/ContactsManagerTest.php
index d15cd74bef8..63491214eb7 100644
--- a/tests/lib/ContactsManagerTest.php
+++ b/tests/lib/ContactsManagerTest.php
@@ -109,6 +109,9 @@ class ContactsManagerTest extends \Test\TestCase {
->method('delete')
->willReturn('returnMe');
+ $addressbook->expects($this->any())
+ ->method('getKey')
+ ->willReturn('addressbookKey');
$this->cm->registerAddressBook($addressbook);
$result = $this->cm->delete(1, $addressbook->getKey());
@@ -128,6 +131,10 @@ class ContactsManagerTest extends \Test\TestCase {
$addressbook->expects($this->never())
->method('delete');
+ $addressbook->expects($this->any())
+ ->method('getKey')
+ ->willReturn('addressbookKey');
+
$this->cm->registerAddressBook($addressbook);
$result = $this->cm->delete(1, $addressbook->getKey());
$this->assertEquals($result, null);
@@ -142,6 +149,10 @@ class ContactsManagerTest extends \Test\TestCase {
$addressbook->expects($this->never())
->method('delete');
+ $addressbook->expects($this->any())
+ ->method('getKey')
+ ->willReturn('addressbookKey');
+
$this->cm->registerAddressBook($addressbook);
$result = $this->cm->delete(1, 'noaddressbook');
$this->assertEquals($result, null);
@@ -161,6 +172,10 @@ class ContactsManagerTest extends \Test\TestCase {
->method('createOrUpdate')
->willReturn('returnMe');
+ $addressbook->expects($this->any())
+ ->method('getKey')
+ ->willReturn('addressbookKey');
+
$this->cm->registerAddressBook($addressbook);
$result = $this->cm->createOrUpdate([], $addressbook->getKey());
$this->assertEquals($result, 'returnMe');
@@ -179,6 +194,10 @@ class ContactsManagerTest extends \Test\TestCase {
$addressbook->expects($this->never())
->method('createOrUpdate');
+ $addressbook->expects($this->any())
+ ->method('getKey')
+ ->willReturn('addressbookKey');
+
$this->cm->registerAddressBook($addressbook);
$result = $this->cm->createOrUpdate([], $addressbook->getKey());
$this->assertEquals($result, null);
@@ -193,6 +212,10 @@ class ContactsManagerTest extends \Test\TestCase {
$addressbook->expects($this->never())
->method('createOrUpdate');
+ $addressbook->expects($this->any())
+ ->method('getKey')
+ ->willReturn('addressbookKey');
+
$this->cm->registerAddressBook($addressbook);
$result = $this->cm->createOrUpdate([], 'noaddressbook');
$this->assertEquals($result, null);
@@ -209,6 +232,10 @@ class ContactsManagerTest extends \Test\TestCase {
->disableOriginalConstructor()
->getMock();
+ $addressbook->expects($this->any())
+ ->method('getKey')
+ ->willReturn('addressbookKey');
+
$this->cm->registerAddressBook($addressbook);
$result = $this->cm->isEnabled();
$this->assertTrue($result);