diff options
author | Mario <mario@mariovavti.com> | 2019-11-10 12:49:51 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-11-10 14:10:03 +0100 |
commit | 580c3f4ffe9608d2beb56d418c68b3b112420e76 (patch) | |
tree | 82335d01179ac361d3f547a4b8e8c598d302e9f3 /vendor/sabre/dav/tests/Sabre/CardDAV/CardTest.php | |
parent | d22766f458a8539a40a57f3946459a9be1f21cd6 (diff) | |
download | volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.gz volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.bz2 volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.zip |
another bulk of composer updates
(cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce)
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CardDAV/CardTest.php')
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/CardDAV/CardTest.php | 132 |
1 files changed, 59 insertions, 73 deletions
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 @@ <?php -namespace Sabre\CardDAV; +declare(strict_types=1); -class CardTest extends \PHPUnit_Framework_TestCase { +namespace Sabre\CardDAV; +class CardTest extends \PHPUnit\Framework\TestCase +{ /** * @var Sabre\CardDAV\Card */ @@ -13,140 +15,128 @@ class CardTest extends \PHPUnit_Framework_TestCase { */ protected $backend; - function setUp() { - + public function setUp() + { $this->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() ); - } - } |