diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-15 14:13:04 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-15 14:29:24 +0100 |
commit | df7280a3c7c84671aa0596146503e7a13213b862 (patch) | |
tree | b0c63902012c01641a6ad280cb39b4838223d386 /apps/dav/tests/unit/carddav | |
parent | 46b39c3465e2db9ba26b23d8d0dfca6cc670aaea (diff) | |
download | nextcloud-server-df7280a3c7c84671aa0596146503e7a13213b862.tar.gz nextcloud-server-df7280a3c7c84671aa0596146503e7a13213b862.zip |
Queries on the cards table by uri require the addressbook as well - fixes #22284
Diffstat (limited to 'apps/dav/tests/unit/carddav')
-rw-r--r-- | apps/dav/tests/unit/carddav/addressbookimpltest.php | 2 | ||||
-rw-r--r-- | apps/dav/tests/unit/carddav/carddavbackendtest.php | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/apps/dav/tests/unit/carddav/addressbookimpltest.php b/apps/dav/tests/unit/carddav/addressbookimpltest.php index ff7b982abd4..f2c739e046d 100644 --- a/apps/dav/tests/unit/carddav/addressbookimpltest.php +++ b/apps/dav/tests/unit/carddav/addressbookimpltest.php @@ -261,7 +261,7 @@ class AddressBookImplTest extends TestCase { // simulate that 'uid0' already exists, so the second uid will be returned $this->backend->expects($this->exactly(2))->method('getContact') ->willReturnCallback( - function($uid) { + function($id, $uid) { return ($uid === 'uid0.vcf'); } ); diff --git a/apps/dav/tests/unit/carddav/carddavbackendtest.php b/apps/dav/tests/unit/carddav/carddavbackendtest.php index f7e59b3fda9..3b5395fb09e 100644 --- a/apps/dav/tests/unit/carddav/carddavbackendtest.php +++ b/apps/dav/tests/unit/carddav/carddavbackendtest.php @@ -44,7 +44,7 @@ class CardDavBackendTest extends TestCase { /** @var CardDavBackend */ private $backend; - /** @var Principal | \PHPUnit_Framework_MockObject_MockObject */ + /** @var Principal | \PHPUnit_Framework_MockObject_MockObject */ private $principal; /** @var IDBConnection */ @@ -268,7 +268,7 @@ class CardDavBackendTest extends TestCase { // create a new address book $this->backend->expects($this->once()) ->method('getCardId') - ->with($uri) + ->with($bookId, $uri) ->willThrowException(new \InvalidArgumentException()); $this->backend->expects($this->exactly(2)) ->method('addChange') @@ -445,14 +445,14 @@ class CardDavBackendTest extends TestCase { $id = $query->getLastInsertId(); $this->assertSame($id, - $this->invokePrivate($this->backend, 'getCardId', ['uri'])); + $this->invokePrivate($this->backend, 'getCardId', [1, 'uri'])); } /** * @expectedException InvalidArgumentException */ public function testGetCardIdFailed() { - $this->invokePrivate($this->backend, 'getCardId', ['uri']); + $this->invokePrivate($this->backend, 'getCardId', [1, 'uri']); } /** @@ -596,7 +596,7 @@ class CardDavBackendTest extends TestCase { $query->execute(); } - $result = $this->backend->getContact('uri0'); + $result = $this->backend->getContact(0, 'uri0'); $this->assertSame(7, count($result)); $this->assertSame(0, (int)$result['addressbookid']); $this->assertSame('uri0', $result['uri']); @@ -606,7 +606,7 @@ class CardDavBackendTest extends TestCase { } public function testGetContactFail() { - $this->assertEmpty($this->backend->getContact('uri')); + $this->assertEmpty($this->backend->getContact(0, 'uri')); } public function testCollectCardProperties() { |