diff options
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CalDAV/Principal')
4 files changed, 0 insertions, 261 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/CollectionTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/CollectionTest.php deleted file mode 100644 index 277de0664..000000000 --- a/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/CollectionTest.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Sabre\CalDAV\Principal; - -use Sabre\DAVACL; - -class CollectionTest extends \PHPUnit\Framework\TestCase -{ - public function testGetChildForPrincipal() - { - $back = new DAVACL\PrincipalBackend\Mock(); - $col = new Collection($back); - $r = $col->getChildForPrincipal([ - 'uri' => 'principals/admin', - ]); - $this->assertInstanceOf('Sabre\\CalDAV\\Principal\\User', $r); - } -} diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/ProxyReadTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/ProxyReadTest.php deleted file mode 100644 index 95ff86fa1..000000000 --- a/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/ProxyReadTest.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Sabre\CalDAV\Principal; - -use Sabre\DAVACL; - -class ProxyReadTest extends \PHPUnit\Framework\TestCase -{ - protected $backend; - - public function getInstance() - { - $backend = new DAVACL\PrincipalBackend\Mock(); - $principal = new ProxyRead($backend, [ - 'uri' => 'principal/user', - ]); - $this->backend = $backend; - - return $principal; - } - - public function testGetName() - { - $i = $this->getInstance(); - $this->assertEquals('calendar-proxy-read', $i->getName()); - } - - public function testGetDisplayName() - { - $i = $this->getInstance(); - $this->assertEquals('calendar-proxy-read', $i->getDisplayName()); - } - - public function testGetLastModified() - { - $i = $this->getInstance(); - $this->assertNull($i->getLastModified()); - } - - public function testDelete() - { - $this->expectException('Sabre\DAV\Exception\Forbidden'); - $i = $this->getInstance(); - $i->delete(); - } - - public function testSetName() - { - $this->expectException('Sabre\DAV\Exception\Forbidden'); - $i = $this->getInstance(); - $i->setName('foo'); - } - - public function testGetAlternateUriSet() - { - $i = $this->getInstance(); - $this->assertEquals([], $i->getAlternateUriSet()); - } - - public function testGetPrincipalUri() - { - $i = $this->getInstance(); - $this->assertEquals('principal/user/calendar-proxy-read', $i->getPrincipalUrl()); - } - - public function testGetGroupMemberSet() - { - $i = $this->getInstance(); - $this->assertEquals([], $i->getGroupMemberSet()); - } - - public function testGetGroupMembership() - { - $i = $this->getInstance(); - $this->assertEquals([], $i->getGroupMembership()); - } - - public function testSetGroupMemberSet() - { - $i = $this->getInstance(); - $i->setGroupMemberSet(['principals/foo']); - - $expected = [ - $i->getPrincipalUrl() => ['principals/foo'], - ]; - - $this->assertEquals($expected, $this->backend->groupMembers); - } -} diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/ProxyWriteTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/ProxyWriteTest.php deleted file mode 100644 index df1715ee5..000000000 --- a/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/ProxyWriteTest.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Sabre\CalDAV\Principal; - -use Sabre\DAVACL; - -class ProxyWriteTest extends ProxyReadTest -{ - public function getInstance() - { - $backend = new DAVACL\PrincipalBackend\Mock(); - $principal = new ProxyWrite($backend, [ - 'uri' => 'principal/user', - ]); - $this->backend = $backend; - - return $principal; - } - - public function testGetName() - { - $i = $this->getInstance(); - $this->assertEquals('calendar-proxy-write', $i->getName()); - } - - public function testGetDisplayName() - { - $i = $this->getInstance(); - $this->assertEquals('calendar-proxy-write', $i->getDisplayName()); - } - - public function testGetPrincipalUri() - { - $i = $this->getInstance(); - $this->assertEquals('principal/user/calendar-proxy-write', $i->getPrincipalUrl()); - } -} diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/UserTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/UserTest.php deleted file mode 100644 index fd079acb2..000000000 --- a/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/UserTest.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Sabre\CalDAV\Principal; - -use Sabre\DAVACL; - -class UserTest extends \PHPUnit\Framework\TestCase -{ - public function getInstance() - { - $backend = new DAVACL\PrincipalBackend\Mock(); - $backend->addPrincipal([ - 'uri' => 'principals/user/calendar-proxy-read', - ]); - $backend->addPrincipal([ - 'uri' => 'principals/user/calendar-proxy-write', - ]); - $backend->addPrincipal([ - 'uri' => 'principals/user/random', - ]); - - return new User($backend, [ - 'uri' => 'principals/user', - ]); - } - - public function testCreateFile() - { - $this->expectException('Sabre\DAV\Exception\Forbidden'); - $u = $this->getInstance(); - $u->createFile('test'); - } - - public function testCreateDirectory() - { - $this->expectException('Sabre\DAV\Exception\Forbidden'); - $u = $this->getInstance(); - $u->createDirectory('test'); - } - - public function testGetChildProxyRead() - { - $u = $this->getInstance(); - $child = $u->getChild('calendar-proxy-read'); - $this->assertInstanceOf('Sabre\\CalDAV\\Principal\\ProxyRead', $child); - } - - public function testGetChildProxyWrite() - { - $u = $this->getInstance(); - $child = $u->getChild('calendar-proxy-write'); - $this->assertInstanceOf('Sabre\\CalDAV\\Principal\\ProxyWrite', $child); - } - - public function testGetChildNotFound() - { - $this->expectException('Sabre\DAV\Exception\NotFound'); - $u = $this->getInstance(); - $child = $u->getChild('foo'); - } - - public function testGetChildNotFound2() - { - $this->expectException('Sabre\DAV\Exception\NotFound'); - $u = $this->getInstance(); - $child = $u->getChild('random'); - } - - public function testGetChildren() - { - $u = $this->getInstance(); - $children = $u->getChildren(); - $this->assertEquals(2, count($children)); - $this->assertInstanceOf('Sabre\\CalDAV\\Principal\\ProxyRead', $children[0]); - $this->assertInstanceOf('Sabre\\CalDAV\\Principal\\ProxyWrite', $children[1]); - } - - public function testChildExist() - { - $u = $this->getInstance(); - $this->assertTrue($u->childExists('calendar-proxy-read')); - $this->assertTrue($u->childExists('calendar-proxy-write')); - $this->assertFalse($u->childExists('foo')); - } - - public function testGetACL() - { - $expected = [ - [ - 'privilege' => '{DAV:}all', - 'principal' => '{DAV:}owner', - 'protected' => true, - ], - [ - 'privilege' => '{DAV:}read', - 'principal' => 'principals/user/calendar-proxy-read', - 'protected' => true, - ], - [ - 'privilege' => '{DAV:}read', - 'principal' => 'principals/user/calendar-proxy-write', - 'protected' => true, - ], - ]; - - $u = $this->getInstance(); - $this->assertEquals($expected, $u->getACL()); - } -} |