function testCreateCalendarObject() { $backend = new Sabre_CalDAV_Backend_PDO($this->pdo); $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', array()); $backend->createCalendarObject($returnedId, 'random-id', 'calendar-data'); $data = $backend->getCalendarObject($returnedId, 'random-id'); $this->assertEquals('calendar-data', $data['calendardata']); $this->assertEquals($returnedId, $data['calendarid']); $this->assertEquals('random-id', $data['uri']); }
/** * @depends testCreateCalendarObject */ function testDeleteCalendarObject() { $backend = new Sabre_CalDAV_Backend_PDO($this->pdo); $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', array()); $object = "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n"; $backend->createCalendarObject($returnedId, 'random-id', $object); $backend->deleteCalendarObject($returnedId, 'random-id'); $data = $backend->getCalendarObject($returnedId, 'random-id'); $this->assertNull($data); }