caldavBackend->createCalendar( 'principals/user1', 'default', [ ] ); $this->caldavBackend->createCalendar( 'principals/user2', 'default', [ ] ); } function testDelivery() { $request = new Request('PUT', '/calendars/user1/default/foo.ics'); $request->setBody(<<server->on('schedule', function($message) use (&$messages) { $messages[] = $message; }); $response = $this->request($request); $this->assertEquals(201, $response->getStatus(), 'Incorrect status code received. Response body:' . $response->getBodyAsString()); $result = $this->request(new Request('GET', '/calendars/user1/default/foo.ics'))->getBody(); $resultVObj = VObject\Reader::read($result); $this->assertEquals( '1.2', $resultVObj->VEVENT->ATTENDEE[1]['SCHEDULE-STATUS']->getValue() ); $this->assertEquals(1, count($messages)); $message = $messages[0]; $this->assertInstanceOf('\Sabre\VObject\ITip\Message', $message); $this->assertEquals('mailto:user2.sabredav@sabredav.org', $message->recipient); $this->assertEquals('Roxy Kesh', $message->recipientName); $this->assertEquals('mailto:user1.sabredav@sabredav.org', $message->sender); $this->assertEquals('Administrator', $message->senderName); $this->assertEquals('REQUEST', $message->method); $this->assertEquals('REQUEST', $message->message->METHOD->getValue()); } }