mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-09 01:48:48 +00:00
Heavily refactored, including multiple calendars per user and recurring events. Not in an installable state yet, though
This commit is contained in:
parent
4a5e30ec84
commit
fefee23e90
78 changed files with 8026 additions and 1205 deletions
|
@ -191,7 +191,17 @@ class Sabre_CalDAV_OutboxPostTest extends Sabre_DAVServerTest {
|
|||
|
||||
$req->setBody(implode("\r\n",$body));
|
||||
|
||||
$this->assertHTTPStatus(501, $req);
|
||||
|
||||
$response = $this->request($req);
|
||||
$this->assertEquals('HTTP/1.1 200 OK', $response->status);
|
||||
$this->assertEquals(array(
|
||||
'Content-Type' => 'application/xml',
|
||||
), $response->headers);
|
||||
|
||||
// Lazily checking the body for a few expected values.
|
||||
$this->assertTrue(strpos($response->body, '5.2;')!==false);
|
||||
$this->assertTrue(strpos($response->body,'user2@example.org')!==false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -218,7 +228,66 @@ class Sabre_CalDAV_OutboxPostTest extends Sabre_DAVServerTest {
|
|||
$handler = new Sabre_CalDAV_Schedule_IMip_Mock('server@example.org');
|
||||
|
||||
$this->caldavPlugin->setIMIPhandler($handler);
|
||||
$this->assertHTTPStatus(200, $req);
|
||||
|
||||
$response = $this->request($req);
|
||||
$this->assertEquals('HTTP/1.1 200 OK', $response->status);
|
||||
$this->assertEquals(array(
|
||||
'Content-Type' => 'application/xml',
|
||||
), $response->headers);
|
||||
|
||||
// Lazily checking the body for a few expected values.
|
||||
$this->assertTrue(strpos($response->body, '2.0;')!==false);
|
||||
$this->assertTrue(strpos($response->body,'user2@example.org')!==false);
|
||||
|
||||
$this->assertEquals(array(
|
||||
array(
|
||||
'to' => 'user2@example.org',
|
||||
'subject' => 'Invitation for: An invitation',
|
||||
'body' => implode("\r\n", $body) . "\r\n",
|
||||
'headers' => array(
|
||||
'Reply-To: user1.sabredav@sabredav.org',
|
||||
'From: server@example.org',
|
||||
'Content-Type: text/calendar; method=REQUEST; charset=utf-8',
|
||||
'X-Sabre-Version: ' . Sabre_DAV_Version::VERSION . '-' . Sabre_DAV_Version::STABILITY,
|
||||
),
|
||||
)
|
||||
), $handler->getSentEmails());
|
||||
|
||||
}
|
||||
|
||||
function testSuccessRequestUpperCased() {
|
||||
|
||||
$req = new Sabre_HTTP_Request(array(
|
||||
'REQUEST_METHOD' => 'POST',
|
||||
'REQUEST_URI' => '/calendars/user1/outbox',
|
||||
'HTTP_ORIGINATOR' => 'MAILTO:user1.sabredav@sabredav.org',
|
||||
'HTTP_RECIPIENT' => 'MAILTO:user2@example.org',
|
||||
));
|
||||
|
||||
$body = array(
|
||||
'BEGIN:VCALENDAR',
|
||||
'METHOD:REQUEST',
|
||||
'BEGIN:VEVENT',
|
||||
'SUMMARY:An invitation',
|
||||
'END:VEVENT',
|
||||
'END:VCALENDAR',
|
||||
);
|
||||
|
||||
$req->setBody(implode("\r\n",$body));
|
||||
|
||||
$handler = new Sabre_CalDAV_Schedule_IMip_Mock('server@example.org');
|
||||
|
||||
$this->caldavPlugin->setIMIPhandler($handler);
|
||||
|
||||
$response = $this->request($req);
|
||||
$this->assertEquals('HTTP/1.1 200 OK', $response->status);
|
||||
$this->assertEquals(array(
|
||||
'Content-Type' => 'application/xml',
|
||||
), $response->headers);
|
||||
|
||||
// Lazily checking the body for a few expected values.
|
||||
$this->assertTrue(strpos($response->body, '2.0;')!==false);
|
||||
$this->assertTrue(strpos($response->body,'user2@example.org')!==false);
|
||||
|
||||
$this->assertEquals(array(
|
||||
array(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue