mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Fix ContactsManagerTest adressbook mocks having a null key
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
5c78adb20d
commit
637cafcf35
1 changed files with 27 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue