Add FtpCredentials entity

This commit is contained in:
Nicolas Le Goff
2013-08-14 18:09:22 +02:00
parent 8790399214
commit 6a8312ca64
19 changed files with 591 additions and 536 deletions

View File

@@ -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;
}));