From 580c3f4ffe9608d2beb56d418c68b3b112420e76 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 10 Nov 2019 12:49:51 +0000 Subject: another bulk of composer updates (cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce) --- vendor/sabre/dav/tests/Sabre/CardDAV/CardTest.php | 132 ++++++++++------------ 1 file changed, 59 insertions(+), 73 deletions(-) (limited to 'vendor/sabre/dav/tests/Sabre/CardDAV/CardTest.php') diff --git a/vendor/sabre/dav/tests/Sabre/CardDAV/CardTest.php b/vendor/sabre/dav/tests/Sabre/CardDAV/CardTest.php index cb7d152c3..41853aa63 100644 --- a/vendor/sabre/dav/tests/Sabre/CardDAV/CardTest.php +++ b/vendor/sabre/dav/tests/Sabre/CardDAV/CardTest.php @@ -1,9 +1,11 @@ backend = new Backend\Mock(); $this->card = new Card( $this->backend, [ - 'uri' => 'book1', - 'id' => 'foo', + 'uri' => 'book1', + 'id' => 'foo', 'principaluri' => 'principals/user1', ], [ - 'uri' => 'card1', + 'uri' => 'card1', 'addressbookid' => 'foo', - 'carddata' => 'card', + 'carddata' => 'card', ] ); - } - function testGet() { - + public function testGet() + { $result = $this->card->get(); $this->assertEquals('card', $result); - } - function testGet2() { + public function testGet2() + { $this->card = new Card( $this->backend, [ - 'uri' => 'book1', - 'id' => 'foo', + 'uri' => 'book1', + 'id' => 'foo', 'principaluri' => 'principals/user1', ], [ - 'uri' => 'card1', + 'uri' => 'card1', 'addressbookid' => 'foo', ] ); $result = $this->card->get(); $this->assertEquals("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD", $result); - } - /** * @depends testGet */ - function testPut() { - + public function testPut() + { $file = fopen('php://memory', 'r+'); fwrite($file, 'newdata'); rewind($file); $this->card->put($file); $result = $this->card->get(); $this->assertEquals('newdata', $result); - } - - function testDelete() { - + public function testDelete() + { $this->card->delete(); $this->assertEquals(1, count($this->backend->cards['foo'])); - } - function testGetContentType() { - + public function testGetContentType() + { $this->assertEquals('text/vcard; charset=utf-8', $this->card->getContentType()); - } - function testGetETag() { - - $this->assertEquals('"' . md5('card') . '"', $this->card->getETag()); - + public function testGetETag() + { + $this->assertEquals('"'.md5('card').'"', $this->card->getETag()); } - function testGetETag2() { - + public function testGetETag2() + { $card = new Card( $this->backend, [ - 'uri' => 'book1', - 'id' => 'foo', + 'uri' => 'book1', + 'id' => 'foo', 'principaluri' => 'principals/user1', ], [ - 'uri' => 'card1', + 'uri' => 'card1', 'addressbookid' => 'foo', - 'carddata' => 'card', - 'etag' => '"blabla"', + 'carddata' => 'card', + 'etag' => '"blabla"', ] ); $this->assertEquals('"blabla"', $card->getETag()); - } - function testGetLastModified() { - + public function testGetLastModified() + { $this->assertEquals(null, $this->card->getLastModified()); - } - function testGetSize() { - + public function testGetSize() + { $this->assertEquals(4, $this->card->getSize()); $this->assertEquals(4, $this->card->getSize()); - } - function testGetSize2() { - + public function testGetSize2() + { $card = new Card( $this->backend, [ - 'uri' => 'book1', - 'id' => 'foo', + 'uri' => 'book1', + 'id' => 'foo', 'principaluri' => 'principals/user1', ], [ - 'uri' => 'card1', + 'uri' => 'card1', 'addressbookid' => 'foo', - 'etag' => '"blabla"', - 'size' => 4, + 'etag' => '"blabla"', + 'size' => 4, ] ); $this->assertEquals(4, $card->getSize()); - } - function testACLMethods() { - + public function testACLMethods() + { $this->assertEquals('principals/user1', $this->card->getOwner()); $this->assertNull($this->card->getGroup()); $this->assertEquals([ @@ -156,22 +146,22 @@ class CardTest extends \PHPUnit_Framework_TestCase { 'protected' => true, ], ], $this->card->getACL()); - } - function testOverrideACL() { + public function testOverrideACL() + { $card = new Card( $this->backend, [ - 'uri' => 'book1', - 'id' => 'foo', + 'uri' => 'book1', + 'id' => 'foo', 'principaluri' => 'principals/user1', ], [ - 'uri' => 'card1', + 'uri' => 'card1', 'addressbookid' => 'foo', - 'carddata' => 'card', - 'acl' => [ + 'carddata' => 'card', + 'acl' => [ [ 'privilege' => '{DAV:}read', 'principal' => 'principals/user1', @@ -187,24 +177,20 @@ class CardTest extends \PHPUnit_Framework_TestCase { 'protected' => true, ], ], $card->getACL()); - } /** - * @expectedException Sabre\DAV\Exception\Forbidden + * @expectedException \Sabre\DAV\Exception\Forbidden */ - function testSetACL() { - - $this->card->setACL([]); - + public function testSetACL() + { + $this->card->setACL([]); } - function testGetSupportedPrivilegeSet() { - + public function testGetSupportedPrivilegeSet() + { $this->assertNull( $this->card->getSupportedPrivilegeSet() ); - } - } -- cgit v1.2.3