]> git.mxchange.org Git - friendica-addons.git/blob - dav/SabreDAV/tests/Sabre/CalDAV/Backend/PDOMySQLTest.php
Merge branch 'master' of git://github.com/friendica/friendica-addons
[friendica-addons.git] / dav / SabreDAV / tests / Sabre / CalDAV / Backend / PDOMySQLTest.php
1 <?php
2
3 require_once 'Sabre/TestUtil.php';
4 require_once 'Sabre/CalDAV/TestUtil.php';
5 require_once 'Sabre/CalDAV/Backend/AbstractPDOTest.php';
6
7 class Sabre_CalDAV_Backend_PDOMySQLTest extends Sabre_CalDAV_Backend_AbstractPDOTest {
8
9     function setup() {
10
11         if (!SABRE_HASMYSQL) $this->markTestSkipped('MySQL driver is not available, or not properly configured');
12         $pdo = Sabre_TestUtil::getMySQLDB();
13         if (!$pdo) $this->markTestSkipped('Could not connect to mysql database');
14
15         $pdo->query('DROP TABLE IF EXISTS calendarobjects, calendars');
16
17         $queries = explode(
18             ';',
19             file_get_contents(__DIR__ . '/../../../../examples/sql/mysql.calendars.sql')
20         );
21
22         foreach($queries as $query) {
23             $query = trim($query," \r\n\t");
24             if ($query)
25                 $pdo->exec($query);
26         }
27         $this->pdo = $pdo;
28
29     }
30
31     function teardown() {
32
33         $this->pdo = null;
34
35     }
36
37 }