Exemple #1
0
 static function getSQLiteDB()
 {
     $pdo = Backend\PDOSqliteTest::getSQLite();
     // Inserting events through a backend class.
     $backend = new Backend\PDO($pdo);
     $addressbookId = $backend->createAddressBook('principals/user1', 'UUID-123467', ['{DAV:}displayname' => 'user1 addressbook', '{urn:ietf:params:xml:ns:carddav}addressbook-description' => 'AddressBook description']);
     $backend->createAddressBook('principals/user1', 'UUID-123468', ['{DAV:}displayname' => 'user1 addressbook2', '{urn:ietf:params:xml:ns:carddav}addressbook-description' => 'AddressBook description']);
     $backend->createCard($addressbookId, 'UUID-2345', self::getTestCardData());
     return $pdo;
 }
Exemple #2
0
 static function getSQLiteDB()
 {
     if (file_exists(SABRE_TEMPDIR . '/testdb.sqlite')) {
         unlink(SABRE_TEMPDIR . '/testdb.sqlite');
     }
     $pdo = new \PDO('sqlite:' . SABRE_TEMPDIR . '/testdb.sqlite');
     $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
     // Yup this is definitely not 'fool proof', but good enough for now.
     $queries = explode(';', file_get_contents(__DIR__ . '/../../../examples/sql/sqlite.calendars.sql'));
     foreach ($queries as $query) {
         $pdo->exec($query);
     }
     // Inserting events through a backend class.
     $backend = new Backend\PDO($pdo);
     $calendarId = $backend->createCalendar('principals/user1', 'UUID-123467', array('{DAV:}displayname' => 'user1 calendar', '{urn:ietf:params:xml:ns:caldav}calendar-description' => 'Calendar description', '{http://apple.com/ns/ical/}calendar-order' => '1', '{http://apple.com/ns/ical/}calendar-color' => '#FF0000'));
     $backend->createCalendar('principals/user1', 'UUID-123468', array('{DAV:}displayname' => 'user1 calendar2', '{urn:ietf:params:xml:ns:caldav}calendar-description' => 'Calendar description', '{http://apple.com/ns/ical/}calendar-order' => '1', '{http://apple.com/ns/ical/}calendar-color' => '#FF0000'));
     $backend->createCalendarObject($calendarId, 'UUID-2345', self::getTestCalendarData());
     return $pdo;
 }
Exemple #3
0
 public function updateReminder($uri, $data, $user)
 {
     $this->backend->updateReminder($uri, $data, $user);
 }