aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/CalDAV
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-05-07 23:35:02 +0200
committerMario <mario@mariovavti.com>2020-05-07 23:35:02 +0200
commitfae70bf0a7f1b566d25e30064f60d58ab150951a (patch)
tree1714511edb85ed0e28034ed9371d5fc515504fd6 /vendor/sabre/dav/tests/Sabre/CalDAV
parentffd2faf8a09a870e8dbecb3ad168e0a9b25941d3 (diff)
downloadvolse-hubzilla-fae70bf0a7f1b566d25e30064f60d58ab150951a.tar.gz
volse-hubzilla-fae70bf0a7f1b566d25e30064f60d58ab150951a.tar.bz2
volse-hubzilla-fae70bf0a7f1b566d25e30064f60d58ab150951a.zip
Revert "composer updates"
This reverts commit dbfe748d274f6843fc91a3071df7be45c4ab5b00
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CalDAV')
-rw-r--r--vendor/sabre/dav/tests/Sabre/CalDAV/Backend/AbstractPDOTest.php46
-rw-r--r--vendor/sabre/dav/tests/Sabre/CalDAV/Backend/Mock.php4
-rw-r--r--vendor/sabre/dav/tests/Sabre/CalDAV/CalendarObjectTest.php26
-rw-r--r--vendor/sabre/dav/tests/Sabre/CalDAV/CalendarTest.php20
-rw-r--r--vendor/sabre/dav/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php1
-rw-r--r--vendor/sabre/dav/tests/Sabre/CalDAV/FreeBusyReportTest.php14
-rw-r--r--vendor/sabre/dav/tests/Sabre/CalDAV/ICSExportPluginTest.php2
-rw-r--r--vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/CollectionTest.php4
-rw-r--r--vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/NodeTest.php4
-rw-r--r--vendor/sabre/dav/tests/Sabre/CalDAV/PluginTest.php6
-rw-r--r--vendor/sabre/dav/tests/Sabre/CalDAV/Principal/ProxyReadTest.php8
-rw-r--r--vendor/sabre/dav/tests/Sabre/CalDAV/Principal/UserTest.php16
-rw-r--r--vendor/sabre/dav/tests/Sabre/CalDAV/SharingPluginTest.php15
-rw-r--r--vendor/sabre/dav/tests/Sabre/CalDAV/TestUtil.php83
-rw-r--r--vendor/sabre/dav/tests/Sabre/CalDAV/ValidateICalTest.php9
15 files changed, 193 insertions, 65 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/Backend/AbstractPDOTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/Backend/AbstractPDOTest.php
index 9460b8922..d2df483cd 100644
--- a/vendor/sabre/dav/tests/Sabre/CalDAV/Backend/AbstractPDOTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CalDAV/Backend/AbstractPDOTest.php
@@ -15,7 +15,7 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
protected $pdo;
- public function setup(): void
+ public function setUp()
{
$this->dropTables([
'calendarobjects',
@@ -67,7 +67,7 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
'share-access' => \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER,
];
- $this->assertIsArray($calendars);
+ $this->assertInternalType('array', $calendars);
$this->assertEquals(1, count($calendars));
foreach ($elementCheck as $name => $value) {
@@ -112,7 +112,7 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
'{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp' => new CalDAV\Xml\Property\ScheduleCalendarTransp('transparent'),
];
- $this->assertIsArray($calendars);
+ $this->assertInternalType('array', $calendars);
$this->assertEquals(1, count($calendars));
foreach ($elementCheck as $name => $value) {
@@ -123,10 +123,10 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testConstruct
+ * @expectedException \InvalidArgumentException
*/
public function testUpdateCalendarBadId()
{
- $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
//Creating a new calendar
@@ -186,10 +186,10 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testCreateCalendarAndFetch
+ * @expectedException \InvalidArgumentException
*/
public function testDeleteCalendarBadID()
{
- $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
$returnedId = $backend->createCalendar('principals/user2', 'somerandomid', [
'{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set' => new CalDAV\Xml\Property\SupportedCalendarComponentSet(['VEVENT']),
@@ -201,10 +201,10 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testCreateCalendarAndFetch
+ * @expectedException \Sabre\DAV\Exception
*/
public function testCreateCalendarIncorrectComponentSet()
{
- $this->expectException('Sabre\DAV\Exception');
$backend = new PDO($this->pdo);
//Creating a new calendar
@@ -276,7 +276,7 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
switch ($key) {
case 'lastmodified':
- $this->assertIsInt($actual);
+ $this->assertInternalType('int', $actual);
break;
case 'calendardata':
if (is_resource($actual)) {
@@ -292,20 +292,20 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testGetMultipleObjects
+ * @expectedException \InvalidArgumentException
*/
public function testGetMultipleObjectsBadId()
{
- $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
$backend->getMultipleCalendarObjects('bad-id', ['foo-bar']);
}
/**
+ * @expectedException \Sabre\DAV\Exception\BadRequest
* @depends testCreateCalendarObject
*/
public function testCreateCalendarObjectNoComponent()
{
- $this->expectException('Sabre\DAV\Exception\BadRequest');
$backend = new PDO($this->pdo);
$returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
@@ -345,10 +345,10 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testCreateCalendarObject
+ * @expectedException \InvalidArgumentException
*/
public function testCreateCalendarObjectBadId()
{
- $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
$returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
@@ -519,20 +519,20 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testGetCalendarObjects
+ * @expectedException \InvalidArgumentException
*/
public function testGetCalendarObjectsBadId()
{
- $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
$backend->getCalendarObjects('bad-id');
}
/**
* @depends testGetCalendarObjects
+ * @expectedException \InvalidArgumentException
*/
public function testGetCalendarObjectBadId()
{
- $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
$backend->getCalendarObject('bad-id', 'foo-bar');
}
@@ -582,10 +582,10 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testUpdateCalendarObject
+ * @expectedException \InvalidArgumentException
*/
public function testUpdateCalendarObjectBadId()
{
- $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
$backend->updateCalendarObject('bad-id', 'object-id', 'objectdata');
}
@@ -608,10 +608,10 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testDeleteCalendarObject
+ * @expectedException \InvalidArgumentException
*/
public function testDeleteCalendarObjectBadId()
{
- $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
$returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
@@ -644,11 +644,11 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
}
/**
+ * @expectedException \InvalidArgumentException
* @depends testCalendarQueryNoResult
*/
public function testCalendarQueryBadId()
{
- $this->expectException('InvalidArgumentException');
$abstract = new PDO($this->pdo);
$filters = [
'name' => 'VCALENDAR',
@@ -859,10 +859,10 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testGetChanges
+ * @expectedException \InvalidArgumentException
*/
public function testGetChangesBadId()
{
- $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
$id = $backend->createCalendar(
'principals/user1',
@@ -903,9 +903,11 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
}
}
+ /**
+ * @expectedException \Sabre\DAV\Exception\Forbidden
+ */
public function testCreateSubscriptionFail()
{
- $this->expectException('Sabre\DAV\Exception\Forbidden');
$props = [
];
@@ -1107,10 +1109,10 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testGetInvites
+ * @expectedException \InvalidArgumentException
*/
public function testGetInvitesBadId()
{
- $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
// creating a new calendar
@@ -1257,10 +1259,10 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testUpdateInvites
+ * @expectedException \InvalidArgumentException
*/
public function testUpdateInvitesBadId()
{
- $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
// Add a new invite
$backend->updateInvites(
@@ -1314,7 +1316,7 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
],
]),
];
- $this->assertEqualsCanonicalizing($expected, $result);
+ $this->assertEquals($expected, $result, null, 0.0, 10, true); // Last argument is $canonicalize = true, which allows us to compare, ignoring the order, because it's different between MySQL and Sqlite.
}
/**
@@ -1388,9 +1390,11 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
$this->assertEquals($expected, $result);
}
+ /**
+ * @expectedException \Sabre\DAV\Exception\NotImplemented
+ */
public function testSetPublishStatus()
{
- $this->expectException('Sabre\DAV\Exception\NotImplemented');
$backend = new PDO($this->pdo);
$backend->setPublishStatus([1, 1], true);
}
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/Backend/Mock.php b/vendor/sabre/dav/tests/Sabre/CalDAV/Backend/Mock.php
index 01ac1b39e..9f18eeb72 100644
--- a/vendor/sabre/dav/tests/Sabre/CalDAV/Backend/Mock.php
+++ b/vendor/sabre/dav/tests/Sabre/CalDAV/Backend/Mock.php
@@ -65,6 +65,7 @@ class Mock extends AbstractBackend
*
* @param string $principalUri
* @param string $calendarUri
+ * @param array $properties
*
* @return string|int
*/
@@ -93,7 +94,8 @@ class Mock extends AbstractBackend
*
* Read the PropPatch documentation for more info and examples.
*
- * @param mixed $calendarId
+ * @param mixed $calendarId
+ * @param \Sabre\DAV\PropPatch $propPatch
*/
public function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch)
{
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/CalendarObjectTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/CalendarObjectTest.php
index b7eb4539e..d6073514f 100644
--- a/vendor/sabre/dav/tests/Sabre/CalDAV/CalendarObjectTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CalDAV/CalendarObjectTest.php
@@ -4,6 +4,8 @@ declare(strict_types=1);
namespace Sabre\CalDAV;
+require_once 'Sabre/CalDAV/TestUtil.php';
+
class CalendarObjectTest extends \PHPUnit\Framework\TestCase
{
/**
@@ -16,7 +18,7 @@ class CalendarObjectTest extends \PHPUnit\Framework\TestCase
protected $calendar;
protected $principalBackend;
- public function setup(): void
+ public function setup()
{
$this->backend = TestUtil::getBackend();
@@ -25,7 +27,7 @@ class CalendarObjectTest extends \PHPUnit\Framework\TestCase
$this->calendar = new Calendar($this->backend, $calendars[0]);
}
- public function teardown(): void
+ public function teardown()
{
unset($this->calendar);
unset($this->backend);
@@ -36,15 +38,17 @@ class CalendarObjectTest extends \PHPUnit\Framework\TestCase
$children = $this->calendar->getChildren();
$this->assertTrue($children[0] instanceof CalendarObject);
- $this->assertIsString($children[0]->getName());
- $this->assertIsString($children[0]->get());
- $this->assertIsString($children[0]->getETag());
+ $this->assertInternalType('string', $children[0]->getName());
+ $this->assertInternalType('string', $children[0]->get());
+ $this->assertInternalType('string', $children[0]->getETag());
$this->assertEquals('text/calendar; charset=utf-8', $children[0]->getContentType());
}
+ /**
+ * @expectedException \InvalidArgumentException
+ */
public function testInvalidArg1()
{
- $this->expectException('InvalidArgumentException');
$obj = new CalendarObject(
new Backend\Mock([], []),
[],
@@ -52,9 +56,11 @@ class CalendarObjectTest extends \PHPUnit\Framework\TestCase
);
}
+ /**
+ * @expectedException \InvalidArgumentException
+ */
public function testInvalidArg2()
{
- $this->expectException('InvalidArgumentException');
$obj = new CalendarObject(
new Backend\Mock([], []),
[],
@@ -131,7 +137,7 @@ class CalendarObjectTest extends \PHPUnit\Framework\TestCase
$obj = $children[0];
$size = $obj->getSize();
- $this->assertIsInt($size);
+ $this->assertInternalType('int', $size);
}
public function testGetOwner()
@@ -213,9 +219,11 @@ class CalendarObjectTest extends \PHPUnit\Framework\TestCase
$this->assertEquals($expected, $calendarObject->getACL());
}
+ /**
+ * @expectedException \Sabre\DAV\Exception\Forbidden
+ */
public function testSetACL()
{
- $this->expectException('Sabre\DAV\Exception\Forbidden');
$children = $this->calendar->getChildren();
$this->assertTrue($children[0] instanceof CalendarObject);
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/CalendarTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/CalendarTest.php
index 18c3ec126..7d6414a80 100644
--- a/vendor/sabre/dav/tests/Sabre/CalDAV/CalendarTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CalDAV/CalendarTest.php
@@ -6,6 +6,8 @@ namespace Sabre\CalDAV;
use Sabre\DAV\PropPatch;
+require_once 'Sabre/CalDAV/TestUtil.php';
+
class CalendarTest extends \PHPUnit\Framework\TestCase
{
/**
@@ -22,7 +24,7 @@ class CalendarTest extends \PHPUnit\Framework\TestCase
*/
protected $calendars;
- public function setup(): void
+ public function setup()
{
$this->backend = TestUtil::getBackend();
@@ -31,7 +33,7 @@ class CalendarTest extends \PHPUnit\Framework\TestCase
$this->calendar = new Calendar($this->backend, $this->calendars[0]);
}
- public function teardown(): void
+ public function teardown()
{
unset($this->backend);
}
@@ -78,11 +80,11 @@ class CalendarTest extends \PHPUnit\Framework\TestCase
}
/**
+ * @expectedException \Sabre\DAV\Exception\NotFound
* @depends testSimple
*/
public function testGetChildNotFound()
{
- $this->expectException('Sabre\DAV\Exception\NotFound');
$this->calendar->getChild('randomname');
}
@@ -108,15 +110,19 @@ class CalendarTest extends \PHPUnit\Framework\TestCase
$this->assertTrue($this->calendar->childExists($children[0]->getName()));
}
+ /**
+ * @expectedException \Sabre\DAV\Exception\MethodNotAllowed
+ */
public function testCreateDirectory()
{
- $this->expectException('Sabre\DAV\Exception\MethodNotAllowed');
$this->calendar->createDirectory('hello');
}
+ /**
+ * @expectedException \Sabre\DAV\Exception\MethodNotAllowed
+ */
public function testSetName()
{
- $this->expectException('Sabre\DAV\Exception\MethodNotAllowed');
$this->calendar->setName('hello');
}
@@ -205,9 +211,11 @@ class CalendarTest extends \PHPUnit\Framework\TestCase
$this->assertEquals($expected, $this->calendar->getACL());
}
+ /**
+ * @expectedException \Sabre\DAV\Exception\Forbidden
+ */
public function testSetACL()
{
- $this->expectException('Sabre\DAV\Exception\Forbidden');
$this->calendar->setACL([]);
}
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php
index 93fc56dae..d6e7b491c 100644
--- a/vendor/sabre/dav/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php
@@ -10,6 +10,7 @@ use Sabre\VObject;
/**
* This unittests is created to find out why recurring events have wrong DTSTART value.
*
+ *
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/FreeBusyReportTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/FreeBusyReportTest.php
index 44823edab..3d4b36313 100644
--- a/vendor/sabre/dav/tests/Sabre/CalDAV/FreeBusyReportTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CalDAV/FreeBusyReportTest.php
@@ -18,7 +18,7 @@ class FreeBusyReportTest extends \PHPUnit\Framework\TestCase
*/
protected $server;
- public function setup(): void
+ public function setUp()
{
$obj1 = <<<ics
BEGIN:VCALENDAR
@@ -108,9 +108,11 @@ XML;
$this->assertTrue(false !== strpos($this->server->httpResponse->body, '20111006T100000Z/20111006T110000Z'));
}
+ /**
+ * @expectedException \Sabre\DAV\Exception\BadRequest
+ */
public function testFreeBusyReportNoTimeRange()
{
- $this->expectException('Sabre\DAV\Exception\BadRequest');
$reportXML = <<<XML
<?xml version="1.0"?>
<c:free-busy-query xmlns:c="urn:ietf:params:xml:ns:caldav">
@@ -120,9 +122,11 @@ XML;
$report = $this->server->xml->parse($reportXML, null, $rootElem);
}
+ /**
+ * @expectedException \Sabre\DAV\Exception\NotImplemented
+ */
public function testFreeBusyReportWrongNode()
{
- $this->expectException('Sabre\DAV\Exception\NotImplemented');
$request = new HTTP\Request('REPORT', '/');
$this->server->httpRequest = $request;
@@ -137,9 +141,11 @@ XML;
$this->plugin->report($rootElem, $report, null);
}
+ /**
+ * @expectedException \Sabre\DAV\Exception
+ */
public function testFreeBusyReportNoACLPlugin()
{
- $this->expectException('Sabre\DAV\Exception');
$this->server = new DAV\Server();
$this->server->httpRequest = new HTTP\Request('REPORT', '/');
$this->plugin = new Plugin();
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/ICSExportPluginTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/ICSExportPluginTest.php
index 8771f538b..8c99e6c46 100644
--- a/vendor/sabre/dav/tests/Sabre/CalDAV/ICSExportPluginTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CalDAV/ICSExportPluginTest.php
@@ -15,7 +15,7 @@ class ICSExportPluginTest extends \Sabre\DAVServerTest
protected $icsExportPlugin;
- public function setup(): void
+ public function setUp()
{
parent::setUp();
$this->icsExportPlugin = new ICSExportPlugin();
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/CollectionTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/CollectionTest.php
index 594241e0d..eceb0b87f 100644
--- a/vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/CollectionTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/CollectionTest.php
@@ -63,9 +63,11 @@ class CollectionTest extends \PHPUnit\Framework\TestCase
$this->assertEquals($expected, $col->getACL());
}
+ /**
+ * @expectedException \Sabre\DAV\Exception\Forbidden
+ */
public function testSetACL()
{
- $this->expectException('Sabre\DAV\Exception\Forbidden');
$col = $this->getInstance();
$col->setACL([]);
}
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/NodeTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/NodeTest.php
index 623525e69..cb19ef962 100644
--- a/vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/NodeTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/NodeTest.php
@@ -73,9 +73,11 @@ class NodeTest extends \PHPUnit\Framework\TestCase
$this->assertEquals($expected, $node->getACL());
}
+ /**
+ * @expectedException \Sabre\DAV\Exception\Forbidden
+ */
public function testSetACL()
{
- $this->expectException('Sabre\DAV\Exception\Forbidden');
$node = $this->getInstance();
$node->setACL([]);
}
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/PluginTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/PluginTest.php
index a4f08f7e5..f065e1ac8 100644
--- a/vendor/sabre/dav/tests/Sabre/CalDAV/PluginTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CalDAV/PluginTest.php
@@ -26,7 +26,7 @@ class PluginTest extends \PHPUnit\Framework\TestCase
*/
protected $caldavBackend;
- public function setup(): void
+ public function setup()
{
$caldavNS = '{urn:ietf:params:xml:ns:caldav}';
@@ -349,7 +349,7 @@ END:VCALENDAR';
}
}
- $this->assertIsArray($newCalendar);
+ $this->assertInternalType('array', $newCalendar);
$keys = [
'uri' => 'NEWCALENDAR',
@@ -394,7 +394,7 @@ END:VCALENDAR';
}
}
- $this->assertIsArray($newCalendar);
+ $this->assertInternalType('array', $newCalendar);
$keys = [
'uri' => 'NEWCALENDAR',
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/ProxyReadTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/ProxyReadTest.php
index 95ff86fa1..8036635b2 100644
--- a/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/ProxyReadTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/ProxyReadTest.php
@@ -39,16 +39,20 @@ class ProxyReadTest extends \PHPUnit\Framework\TestCase
$this->assertNull($i->getLastModified());
}
+ /**
+ * @expectedException \Sabre\DAV\Exception\Forbidden
+ */
public function testDelete()
{
- $this->expectException('Sabre\DAV\Exception\Forbidden');
$i = $this->getInstance();
$i->delete();
}
+ /**
+ * @expectedException \Sabre\DAV\Exception\Forbidden
+ */
public function testSetName()
{
- $this->expectException('Sabre\DAV\Exception\Forbidden');
$i = $this->getInstance();
$i->setName('foo');
}
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/UserTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/UserTest.php
index fd079acb2..2c690c65d 100644
--- a/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/UserTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CalDAV/Principal/UserTest.php
@@ -26,16 +26,20 @@ class UserTest extends \PHPUnit\Framework\TestCase
]);
}
+ /**
+ * @expectedException \Sabre\DAV\Exception\Forbidden
+ */
public function testCreateFile()
{
- $this->expectException('Sabre\DAV\Exception\Forbidden');
$u = $this->getInstance();
$u->createFile('test');
}
+ /**
+ * @expectedException \Sabre\DAV\Exception\Forbidden
+ */
public function testCreateDirectory()
{
- $this->expectException('Sabre\DAV\Exception\Forbidden');
$u = $this->getInstance();
$u->createDirectory('test');
}
@@ -54,16 +58,20 @@ class UserTest extends \PHPUnit\Framework\TestCase
$this->assertInstanceOf('Sabre\\CalDAV\\Principal\\ProxyWrite', $child);
}
+ /**
+ * @expectedException \Sabre\DAV\Exception\NotFound
+ */
public function testGetChildNotFound()
{
- $this->expectException('Sabre\DAV\Exception\NotFound');
$u = $this->getInstance();
$child = $u->getChild('foo');
}
+ /**
+ * @expectedException \Sabre\DAV\Exception\NotFound
+ */
public function testGetChildNotFound2()
{
- $this->expectException('Sabre\DAV\Exception\NotFound');
$u = $this->getInstance();
$child = $u->getChild('random');
}
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/SharingPluginTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/SharingPluginTest.php
index f11af8b95..45c389cc2 100644
--- a/vendor/sabre/dav/tests/Sabre/CalDAV/SharingPluginTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CalDAV/SharingPluginTest.php
@@ -6,17 +6,16 @@ namespace Sabre\CalDAV;
use Sabre\DAV;
use Sabre\DAV\Xml\Element\Sharee;
-use Sabre\DAVServerTest;
use Sabre\HTTP;
-class SharingPluginTest extends DAVServerTest
+class SharingPluginTest extends \Sabre\DAVServerTest
{
protected $setupCalDAV = true;
protected $setupCalDAVSharing = true;
protected $setupACL = true;
protected $autoLogin = 'user1';
- public function setup(): void
+ public function setUp()
{
$this->caldavCalendars = [
[
@@ -52,9 +51,11 @@ class SharingPluginTest extends DAVServerTest
);
}
+ /**
+ * @expectedException \LogicException
+ */
public function testSetupWithoutCoreSharingPlugin()
{
- $this->expectException('LogicException');
$server = new DAV\Server();
$server->addPlugin(
new SharingPlugin()
@@ -179,7 +180,7 @@ RRR;
$request->setBody($xml);
- $this->request($request, 200);
+ $response = $this->request($request, 200);
$this->assertEquals(
[
@@ -229,7 +230,7 @@ RRR;
$request->setBody($xml);
- $this->request($request, 403);
+ $response = $this->request($request, 403);
}
public function testInviteReply()
@@ -288,7 +289,7 @@ RRR;
// If the plugin did not handle this request, it must ensure that the
// body is still accessible by other plugins.
- $this->assertEquals($xml, $request->getBody());
+ $this->assertEquals($xml, $request->getBody(true));
}
public function testPostWithoutContentType()
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/TestUtil.php b/vendor/sabre/dav/tests/Sabre/CalDAV/TestUtil.php
index 5de11a31a..72b5080af 100644
--- a/vendor/sabre/dav/tests/Sabre/CalDAV/TestUtil.php
+++ b/vendor/sabre/dav/tests/Sabre/CalDAV/TestUtil.php
@@ -99,4 +99,87 @@ END:VCALENDAR';
return $calendarData;
}
+
+ public static function getTestTODO($type = 'due')
+ {
+ switch ($type) {
+ case 'due':
+ $extra = 'DUE:20100104T000000Z';
+ break;
+ case 'due2':
+ $extra = 'DUE:20060104T000000Z';
+ break;
+ case 'due_date':
+ $extra = 'DUE;VALUE=DATE:20060104';
+ break;
+ case 'due_tz':
+ $extra = 'DUE;TZID=Asia/Seoul:20060104T000000Z';
+ break;
+ case 'due_dtstart':
+ $extra = "DTSTART:20050223T060000Z\nDUE:20060104T000000Z";
+ break;
+ case 'due_dtstart2':
+ $extra = "DTSTART:20090223T060000Z\nDUE:20100104T000000Z";
+ break;
+ case 'dtstart':
+ $extra = 'DTSTART:20100223T060000Z';
+ break;
+ case 'dtstart2':
+ $extra = 'DTSTART:20060223T060000Z';
+ break;
+ case 'dtstart_date':
+ $extra = 'DTSTART;VALUE=DATE:20100223';
+ break;
+ case 'dtstart_tz':
+ $extra = 'DTSTART;TZID=Asia/Seoul:20100223T060000Z';
+ break;
+ case 'dtstart_duration':
+ $extra = "DTSTART:20061023T060000Z\nDURATION:PT1H";
+ break;
+ case 'dtstart_duration2':
+ $extra = "DTSTART:20101023T060000Z\nDURATION:PT1H";
+ break;
+ case 'completed':
+ $extra = 'COMPLETED:20060601T000000Z';
+ break;
+ case 'completed2':
+ $extra = 'COMPLETED:20090601T000000Z';
+ break;
+ case 'created':
+ $extra = 'CREATED:20060601T000000Z';
+ break;
+ case 'created2':
+ $extra = 'CREATED:20090601T000000Z';
+ break;
+ case 'completedcreated':
+ $extra = "CREATED:20060601T000000Z\nCOMPLETED:20070101T000000Z";
+ break;
+ case 'completedcreated2':
+ $extra = "CREATED:20090601T000000Z\nCOMPLETED:20100101T000000Z";
+ break;
+ case 'notime':
+ $extra = 'X-FILLER:oh hello';
+ break;
+ default:
+ throw new Exception('Unknown type: '.$type);
+ }
+
+ $todo = 'BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//Example Corp.//CalDAV Client//EN
+BEGIN:VTODO
+DTSTAMP:20060205T235335Z
+'.$extra.'
+STATUS:NEEDS-ACTION
+SUMMARY:Task #1
+UID:DDDEEB7915FA61233B861457@example.com
+BEGIN:VALARM
+ACTION:AUDIO
+TRIGGER;RELATED=START:-PT10M
+END:VALARM
+END:VTODO
+END:VCALENDAR';
+
+ return $todo;
+ }
}
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/ValidateICalTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/ValidateICalTest.php
index 4e2411391..fc87184d9 100644
--- a/vendor/sabre/dav/tests/Sabre/CalDAV/ValidateICalTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CalDAV/ValidateICalTest.php
@@ -8,10 +8,12 @@ use Sabre\DAV;
use Sabre\DAVACL;
use Sabre\HTTP;
+require_once 'Sabre/HTTP/ResponseMock.php';
+
class ValidateICalTest extends \PHPUnit\Framework\TestCase
{
/**
- * @var DAV\Server
+ * @var Sabre\DAV\Server
*/
protected $server;
/**
@@ -19,7 +21,7 @@ class ValidateICalTest extends \PHPUnit\Framework\TestCase
*/
protected $calBackend;
- public function setup(): void
+ public function setUp()
{
$calendars = [
[
@@ -54,9 +56,6 @@ class ValidateICalTest extends \PHPUnit\Framework\TestCase
$this->server->httpResponse = $response;
}
- /**
- * @return Sabre\HTTP\ResponseMock
- */
public function request(HTTP\Request $request)
{
$this->server->httpRequest = $request;