firefly-iii/tests/_bootstrap.php

24 lines
567 B
PHP
Raw Normal View History

2014-11-26 14:31:12 -06:00
<?php
// This is global bootstrap for autoloading
2014-12-13 02:36:30 -06:00
$db = realpath(__DIR__ . '/_data') . '/testing.sqlite';
if (!file_exists($db)) {
exec('touch ' . $db);
exec('php artisan migrate --seed --env=testing');
}
2014-12-13 02:36:30 -06:00
exec('cp ' . $db . ' ' . realpath(__DIR__ . '/_data') . '/clean.sqlite');
/**
* Class resetToClean
* @SuppressWarnings("CamelCase")
*/
class resetToClean
{
/**
*
*/
static public function clean()
{
exec('cp ' . realpath(__DIR__ . '/_data') . '/clean.sqlite ' . realpath(__DIR__ . '/_data') . '/testing.sqlite');
}
}