1<?php 2 3namespace Sabre\DAV\Locks\Backend; 4 5require_once 'Sabre/TestUtil.php'; 6 7class PDOMySQLTest extends AbstractTest { 8 9 function getBackend() { 10 11 if (!SABRE_HASMYSQL) $this->markTestSkipped('MySQL driver is not available, or it was not properly configured'); 12 $pdo = \Sabre\TestUtil::getMySQLDB(); 13 if (!$pdo) $this->markTestSkipped('Could not connect to MySQL database'); 14 $pdo->query('DROP TABLE IF EXISTS locks;'); 15 $pdo->query(" 16CREATE TABLE locks ( 17 id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, 18 owner VARCHAR(100), 19 timeout INTEGER UNSIGNED, 20 created INTEGER, 21 token VARCHAR(100), 22 scope TINYINT, 23 depth TINYINT, 24 uri text 25);"); 26 27 $backend = new PDO($pdo); 28 return $backend; 29 30 } 31 32} 33