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/AddressBookTest.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/AddressBookTest.php')
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookTest.php | 115 |
1 files changed, 50 insertions, 65 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookTest.php b/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookTest.php index 1f0064dd3..879816803 100644 --- a/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookTest.php +++ b/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookTest.php @@ -1,11 +1,13 @@ <?php +declare(strict_types=1); + namespace Sabre\CardDAV; use Sabre\DAV\PropPatch; -class AddressBookTest extends \PHPUnit_Framework_TestCase { - +class AddressBookTest extends \PHPUnit\Framework\TestCase +{ use \Sabre\DAV\DbTestHelperTrait; /** @@ -14,98 +16,88 @@ class AddressBookTest extends \PHPUnit_Framework_TestCase { protected $ab; protected $backend; - function setUp() { - + public function setUp() + { $this->backend = new Backend\Mock(); $this->ab = new AddressBook( $this->backend, [ - 'uri' => 'book1', - 'id' => 'foo', + 'uri' => 'book1', + 'id' => 'foo', '{DAV:}displayname' => 'd-name', - 'principaluri' => 'principals/user1', + 'principaluri' => 'principals/user1', ] ); - } - function testGetName() { - + public function testGetName() + { $this->assertEquals('book1', $this->ab->getName()); - } - function testGetChild() { - + public function testGetChild() + { $card = $this->ab->getChild('card1'); $this->assertInstanceOf('Sabre\\CardDAV\\Card', $card); $this->assertEquals('card1', $card->getName()); - } /** - * @expectedException Sabre\DAV\Exception\NotFound + * @expectedException \Sabre\DAV\Exception\NotFound */ - function testGetChildNotFound() { - + public function testGetChildNotFound() + { $card = $this->ab->getChild('card3'); - } - function testGetChildren() { - + public function testGetChildren() + { $cards = $this->ab->getChildren(); $this->assertEquals(2, count($cards)); $this->assertEquals('card1', $cards[0]->getName()); $this->assertEquals('card2', $cards[1]->getName()); - } /** - * @expectedException Sabre\DAV\Exception\MethodNotAllowed + * @expectedException \Sabre\DAV\Exception\MethodNotAllowed */ - function testCreateDirectory() { - + public function testCreateDirectory() + { $this->ab->createDirectory('name'); - } - function testCreateFile() { - + public function testCreateFile() + { $file = fopen('php://memory', 'r+'); fwrite($file, 'foo'); rewind($file); $this->ab->createFile('card2', $file); $this->assertEquals('foo', $this->backend->cards['foo']['card2']); - } - function testDelete() { - + public function testDelete() + { $this->ab->delete(); $this->assertEquals(1, count($this->backend->addressBooks)); - } /** - * @expectedException Sabre\DAV\Exception\MethodNotAllowed + * @expectedException \Sabre\DAV\Exception\MethodNotAllowed */ - function testSetName() { - + public function testSetName() + { $this->ab->setName('foo'); - } - function testGetLastModified() { - + public function testGetLastModified() + { $this->assertNull($this->ab->getLastModified()); - } - function testUpdateProperties() { - + public function testUpdateProperties() + { $propPatch = new PropPatch([ '{DAV:}displayname' => 'barrr', ]); @@ -113,20 +105,18 @@ class AddressBookTest extends \PHPUnit_Framework_TestCase { $this->assertTrue($propPatch->commit()); $this->assertEquals('barrr', $this->backend->addressBooks[0]['{DAV:}displayname']); - } - function testGetProperties() { - + public function testGetProperties() + { $props = $this->ab->getProperties(['{DAV:}displayname']); $this->assertEquals([ '{DAV:}displayname' => 'd-name', ], $props); - } - function testACLMethods() { - + public function testACLMethods() + { $this->assertEquals('principals/user1', $this->ab->getOwner()); $this->assertNull($this->ab->getGroup()); $this->assertEquals([ @@ -136,39 +126,35 @@ class AddressBookTest extends \PHPUnit_Framework_TestCase { 'protected' => true, ], ], $this->ab->getACL()); - } /** - * @expectedException Sabre\DAV\Exception\Forbidden + * @expectedException \Sabre\DAV\Exception\Forbidden */ - function testSetACL() { - - $this->ab->setACL([]); - + public function testSetACL() + { + $this->ab->setACL([]); } - function testGetSupportedPrivilegeSet() { - + public function testGetSupportedPrivilegeSet() + { $this->assertNull( $this->ab->getSupportedPrivilegeSet() ); - } - function testGetSyncTokenNoSyncSupport() { - + public function testGetSyncTokenNoSyncSupport() + { $this->assertNull($this->ab->getSyncToken()); - } - function testGetChangesNoSyncSupport() { + public function testGetChangesNoSyncSupport() + { $this->assertNull($this->ab->getChanges(1, null)); - } - function testGetSyncToken() { - + public function testGetSyncToken() + { $this->driver = 'sqlite'; $this->dropTables(['addressbooks', 'cards', 'addressbookchanges']); $this->createSchema('addressbooks'); @@ -179,8 +165,8 @@ class AddressBookTest extends \PHPUnit_Framework_TestCase { $this->assertEquals(2, $ab->getSyncToken()); } - function testGetSyncToken2() { - + public function testGetSyncToken2() + { $this->driver = 'sqlite'; $this->dropTables(['addressbooks', 'cards', 'addressbookchanges']); $this->createSchema('addressbooks'); @@ -190,5 +176,4 @@ class AddressBookTest extends \PHPUnit_Framework_TestCase { $ab = new AddressBook($backend, ['id' => 1, '{http://sabredav.org/ns}sync-token' => 2]); $this->assertEquals(2, $ab->getSyncToken()); } - } |