1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00
joplin/tests/setup.php
Laurent Cozic 198fc4e85c mod change
2016-12-10 22:35:53 +00:00

28 lines
682 B
PHP
Executable File

<?php
require_once dirname(__FILE__) . '/BaseTestCase.php';
$dbName = 'notes_test';
$structureFile = dirname(dirname(__FILE__)) . '/structure.sql';
$cmd = sprintf("mysql -u root -ppass -e 'DROP DATABASE IF EXISTS %s; CREATE DATABASE %s;'", $dbName, $dbName);
exec($cmd);
$cmd = sprintf("mysql -u root -ppass %s < '%s'", $dbName, $structureFile);
exec($cmd);
$capsule = new \Illuminate\Database\Capsule\Manager();
$capsule->addConnection([
'driver' => 'mysql',
'host' => 'localhost',
'database' => $dbName,
'username' => 'root',
'password' => 'pass',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
]);
$capsule->bootEloquent();