|
|
|
|
@ -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);
|
|
|
|
|
|