mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 12:03:14 +00:00
Add FtpCredentials entity
This commit is contained in:
@@ -60,6 +60,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
self::$time_start = microtime(true);
|
||||
|
||||
self::$DI = new \Pimple();
|
||||
self::initializeSqliteDB();
|
||||
|
||||
$application = new Application('test');
|
||||
|
||||
@@ -68,10 +69,10 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
exit(1);
|
||||
}
|
||||
|
||||
self::createSetOfUserTests($application);
|
||||
|
||||
self::updateTablesSchema($application);
|
||||
|
||||
self::createSetOfUserTests($application);
|
||||
|
||||
self::setCollection($application);
|
||||
|
||||
self::generateRecords($application);
|
||||
@@ -82,6 +83,14 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
}
|
||||
}
|
||||
|
||||
public static function initializeSqliteDB($path = '/tmp/db.sqlite')
|
||||
{
|
||||
if (is_file($path)) {
|
||||
unlink($path);
|
||||
}
|
||||
copy(__DIR__ . '/../db-ref.sqlite', $path);
|
||||
}
|
||||
|
||||
public function createApplication()
|
||||
{
|
||||
|
||||
@@ -129,9 +138,8 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
|
||||
$app['debug'] = true;
|
||||
|
||||
$app['EM'] = $app->share($app->extend('EM', function($em) {
|
||||
@unlink('/tmp/db.sqlite');
|
||||
copy(__DIR__ . '/../db-ref.sqlite', '/tmp/db.sqlite');
|
||||
$app['EM'] = $app->share($app->extend('EM', function($em) use ($phpunit) {
|
||||
$phpunit::initializeSqliteDB();
|
||||
|
||||
return $em;
|
||||
}));
|
||||
@@ -171,9 +179,8 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
|
||||
$app['debug'] = true;
|
||||
|
||||
$app['EM'] = $app->share($app->extend('EM', function($em) {
|
||||
@unlink('/tmp/db.sqlite');
|
||||
copy(__DIR__ . '/../db-ref.sqlite', '/tmp/db.sqlite');
|
||||
$app['EM'] = $app->share($app->extend('EM', function ($em) use ($phpunit) {
|
||||
$phpunit::initializeSqliteDb();
|
||||
|
||||
return $em;
|
||||
}));
|
||||
|
Reference in New Issue
Block a user