summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2016-11-09 13:06:52 +0100
committerGitHub <noreply@github.com>2016-11-09 13:06:52 +0100
commit6a75296ccbd37d11f88f1e69cfe4063a802c438c (patch)
treee31b78a47485cacfd272ae14dba1923d56f55d5d /apps/dav/tests/unit/CardDAV/CardDavBackendTest.php
parent72f45bbfc72336602f6be3740cc25e4144abd7b7 (diff)
parentda55dd1d1f224fec8e61473a48e02759dc1d44e2 (diff)
downloadnextcloud-server-6a75296ccbd37d11f88f1e69cfe4063a802c438c.tar.gz
nextcloud-server-6a75296ccbd37d11f88f1e69cfe4063a802c438c.zip
Merge pull request #1792 from nextcloud/bump_sabre
Bump sabre
Diffstat (limited to 'apps/dav/tests/unit/CardDAV/CardDavBackendTest.php')
-rw-r--r--apps/dav/tests/unit/CardDAV/CardDavBackendTest.php22
1 files changed, 10 insertions, 12 deletions
diff --git a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php
index 890b70d6afa..f4c321fa6d0 100644
--- a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php
+++ b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php
@@ -169,7 +169,7 @@ class CardDavBackendTest extends TestCase {
public function testCardOperations() {
/** @var CardDavBackend | \PHPUnit_Framework_MockObject_MockObject $backend */
- $backend = $this->getMockBuilder('OCA\DAV\CardDAV\CardDavBackend')
+ $backend = $this->getMockBuilder(CardDavBackend::class)
->setConstructorArgs([$this->db, $this->principal, $this->userManager, null])
->setMethods(['updateProperties', 'purgeProperties'])->getMock();
@@ -215,7 +215,7 @@ class CardDavBackendTest extends TestCase {
public function testMultiCard() {
- $this->backend = $this->getMockBuilder('OCA\DAV\CardDAV\CardDavBackend')
+ $this->backend = $this->getMockBuilder(CardDavBackend::class)
->setConstructorArgs([$this->db, $this->principal, $this->userManager, null])
->setMethods(['updateProperties'])->getMock();
@@ -261,8 +261,7 @@ class CardDavBackendTest extends TestCase {
}
public function testDeleteWithoutCard() {
-
- $this->backend = $this->getMockBuilder('OCA\DAV\CardDAV\CardDavBackend')
+ $this->backend = $this->getMockBuilder(CardDavBackend::class)
->setConstructorArgs([$this->db, $this->principal, $this->userManager, null])
->setMethods([
'getCardId',
@@ -302,8 +301,7 @@ class CardDavBackendTest extends TestCase {
}
public function testSyncSupport() {
-
- $this->backend = $this->getMockBuilder('OCA\DAV\CardDAV\CardDavBackend')
+ $this->backend = $this->getMockBuilder(CardDavBackend::class)
->setConstructorArgs([$this->db, $this->principal, $this->userManager, null])
->setMethods(['updateProperties'])->getMock();
@@ -362,7 +360,7 @@ class CardDavBackendTest extends TestCase {
$cardUri = 'card-uri';
$cardId = 2;
- $backend = $this->getMockBuilder('OCA\DAV\CardDAV\CardDavBackend')
+ $backend = $this->getMockBuilder(CardDavBackend::class)
->setConstructorArgs([$this->db, $this->principal, $this->userManager, null])
->setMethods(['getCardId'])->getMock();
@@ -370,8 +368,8 @@ class CardDavBackendTest extends TestCase {
// add properties for new vCard
$vCard = new VCard();
- $vCard->add(new Text($vCard, 'UID', $cardUri));
- $vCard->add(new Text($vCard, 'FN', 'John Doe'));
+ $vCard->UID = $cardUri;
+ $vCard->FN = 'John Doe';
$this->invokePrivate($backend, 'updateProperties', [$bookId, $cardUri, $vCard->serialize()]);
$query = $this->db->getQueryBuilder();
@@ -391,7 +389,7 @@ class CardDavBackendTest extends TestCase {
// update properties for existing vCard
$vCard = new VCard();
- $vCard->add(new Text($vCard, 'FN', 'John Doe'));
+ $vCard->UID = $cardUri;
$this->invokePrivate($backend, 'updateProperties', [$bookId, $cardUri, $vCard->serialize()]);
$query = $this->db->getQueryBuilder();
@@ -399,8 +397,8 @@ class CardDavBackendTest extends TestCase {
$this->assertSame(1, count($result));
- $this->assertSame('FN', $result[0]['name']);
- $this->assertSame('John Doe', $result[0]['value']);
+ $this->assertSame('UID', $result[0]['name']);
+ $this->assertSame($cardUri, $result[0]['value']);
$this->assertSame($bookId, (int)$result[0]['addressbookid']);
$this->assertSame($cardId, (int)$result[0]['cardid']);
}