summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php
diff options
context:
space:
mode:
authorThomas Müller <DeepDiver1975@users.noreply.github.com>2016-10-13 12:15:10 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-11-04 13:35:10 +0100
commitc778b1bade02ea772f23c75cb8de804d645feac4 (patch)
tree0cb07a9bc2fc9bd45e2cb9fd878884d6fa451f0d /apps/dav/tests/unit/CardDAV/AddressBookImplTest.php
parent27304e5694fdec3eebf0700f2a82d9d80e928558 (diff)
downloadnextcloud-server-c778b1bade02ea772f23c75cb8de804d645feac4.tar.gz
nextcloud-server-c778b1bade02ea772f23c75cb8de804d645feac4.zip
Update sabre dav to 3.2 (#26115)
* Update sabre/dav to 3.2.0 * Adjust code to work with sabre/dav 3.2.0 and it's dependencies * Adding own CalDAV plugin to fix calendar home property * Test if there is a user logged in when listing files home * Update sabre version used by integration tests * Disable unauthenticated DAV access This is needed to make Sabre 3.2 behave like we did before. Eventually we should integrate better with the ACL plugin which itself should implement an auth failure when appropriate. ===== * Fixed so cherry-pick was succesfull Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav/tests/unit/CardDAV/AddressBookImplTest.php')
-rw-r--r--apps/dav/tests/unit/CardDAV/AddressBookImplTest.php25
1 files changed, 11 insertions, 14 deletions
diff --git a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php
index fa3cae27dec..bd63f4cdffb 100644
--- a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php
+++ b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php
@@ -31,6 +31,7 @@ namespace OCA\DAV\Tests\unit\CardDAV;
use OCA\DAV\CardDAV\AddressBook;
use OCA\DAV\CardDAV\AddressBookImpl;
use OCA\DAV\CardDAV\CardDavBackend;
+use OCP\IURLGenerator;
use Sabre\VObject\Component\VCard;
use Sabre\VObject\Property\Text;
use Test\TestCase;
@@ -46,7 +47,7 @@ class AddressBookImplTest extends TestCase {
/** @var AddressBook | \PHPUnit_Framework_MockObject_MockObject */
private $addressBook;
- /** @var \OCP\IURLGenerator | \PHPUnit_Framework_MockObject_MockObject */
+ /** @var IURLGenerator | \PHPUnit_Framework_MockObject_MockObject */
private $urlGenerator;
/** @var CardDavBackend | \PHPUnit_Framework_MockObject_MockObject */
@@ -64,16 +65,12 @@ class AddressBookImplTest extends TestCase {
'principaluri' => 'principals/system/system',
'{DAV:}displayname' => 'display name',
];
- $this->addressBook = $this->getMockBuilder('OCA\DAV\CardDAV\AddressBook')
+ $this->addressBook = $this->getMockBuilder(AddressBook::class)
->disableOriginalConstructor()->getMock();
- $this->backend = $this->getMockBuilder('\OCA\DAV\CardDAV\CardDavBackend')
+ $this->backend = $this->getMockBuilder(CardDavBackend::class)
->disableOriginalConstructor()->getMock();
- $this->vCard = $this->getMockBuilder('Sabre\VObject\Component\VCard')
- ->disableOriginalConstructor()
- ->getMock();
- $this->urlGenerator = $this->getMockBuilder('OCP\IURLGenerator')
- ->disableOriginalConstructor()
- ->getMock();
+ $this->vCard = $this->createMock(VCard::class);
+ $this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->addressBookImpl = new AddressBookImpl(
$this->addressBook,
@@ -96,7 +93,7 @@ class AddressBookImplTest extends TestCase {
public function testSearch() {
/** @var \PHPUnit_Framework_MockObject_MockObject | AddressBookImpl $addressBookImpl */
- $addressBookImpl = $this->getMockBuilder('OCA\DAV\CardDAV\AddressBookImpl')
+ $addressBookImpl = $this->getMockBuilder(AddressBookImpl::class)
->setConstructorArgs(
[
$this->addressBook,
@@ -143,7 +140,7 @@ class AddressBookImplTest extends TestCase {
$uid = 'uid';
/** @var \PHPUnit_Framework_MockObject_MockObject | AddressBookImpl $addressBookImpl */
- $addressBookImpl = $this->getMockBuilder('OCA\DAV\CardDAV\AddressBookImpl')
+ $addressBookImpl = $this->getMockBuilder(AddressBookImpl::class)
->setConstructorArgs(
[
$this->addressBook,
@@ -184,7 +181,7 @@ class AddressBookImplTest extends TestCase {
$properties = ['URI' => $uri, 'UID' => $uid, 'FN' => 'John Doe'];
/** @var \PHPUnit_Framework_MockObject_MockObject | AddressBookImpl $addressBookImpl */
- $addressBookImpl = $this->getMockBuilder('OCA\DAV\CardDAV\AddressBookImpl')
+ $addressBookImpl = $this->getMockBuilder(AddressBookImpl::class)
->setConstructorArgs(
[
$this->addressBook,
@@ -267,7 +264,7 @@ class AddressBookImplTest extends TestCase {
public function testCreateUid() {
/** @var \PHPUnit_Framework_MockObject_MockObject | AddressBookImpl $addressBookImpl */
- $addressBookImpl = $this->getMockBuilder('OCA\DAV\CardDAV\AddressBookImpl')
+ $addressBookImpl = $this->getMockBuilder(AddressBookImpl::class)
->setConstructorArgs(
[
$this->addressBook,
@@ -299,7 +296,7 @@ class AddressBookImplTest extends TestCase {
public function testCreateEmptyVCard() {
$uid = 'uid';
$expectedVCard = new VCard();
- $expectedVCard->add(new Text($expectedVCard, 'UID', $uid));
+ $expectedVCard->UID = $uid;
$expectedVCardSerialized = $expectedVCard->serialize();
$result = $this->invokePrivate($this->addressBookImpl, 'createEmptyVCard', [$uid]);