public static function setUpBeforeClass()
{
self::_migrate_sql_rdo(self::$db);
// read sql file for statements
$statements = array();
$current_stmt = '';
$fp = fopen(__DIR__ . '/../fixtures/unit_tests.sql', 'r');
while ($line = fgets($fp, 8192)) {
$line = rtrim(preg_replace('/^(.*)--.*$/s', '\\1', $line));
if (!$line) {
continue;
}
$current_stmt .= $line;
if (substr($line, -1) == ';') {
// leave off the ending ;
$statements[] = substr($current_stmt, 0, -1);
$current_stmt = '';
}
}
// run statements
foreach ($statements as $stmt) {
self::$db->execute($stmt);
}
}