mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Fix tests
This commit is contained in:
26
bin/console
26
bin/console
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @package
|
||||
* @package KonsoleKomander
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
@@ -23,31 +23,31 @@ use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Application;
|
||||
|
||||
require_once dirname(__FILE__) . '/../lib/classes/bootstrap.class.php';
|
||||
$Core = require_once dirname(__FILE__) . '/../lib/bootstrap.php';
|
||||
|
||||
$result_code = 1;
|
||||
|
||||
try
|
||||
{
|
||||
\bootstrap::register_autoloads();
|
||||
|
||||
|
||||
$app = new Application("
|
||||
_____ _ _ _____ _____ ______ _ _ ______ _______
|
||||
_____ _ _ _____ _____ ______ _ _ ______ _______
|
||||
| __ \| | | | __ \ /\ / ____| ____| /\ | \ | | ____|__ __|
|
||||
| |__) | |__| | |__) | / \ | (___ | |__ / \ | \| | |__ | |
|
||||
| ___/| __ | _ / / /\ \ \___ \| __| / /\ \ | . ` | __| | |
|
||||
| | | | | | | \ \ / ____ \ ____) | |____ / ____ \| |\ | |____ | |
|
||||
|_| |_| |_|_| \_|_/ \_\_____/|______/_/ \_\_| \_|______| |_|
|
||||
_ __ _ _ __ _
|
||||
| |/ /___ _ _ ___ ___| |___ | |/ /___ _ __ _ __ __ _ _ _ __| |___ _ _
|
||||
| |__) | |__| | |__) | / \ | (___ | |__ / \ | \| | |__ | |
|
||||
| ___/| __ | _ / / /\ \ \___ \| __| / /\ \ | . ` | __| | |
|
||||
| | | | | | | \ \ / ____ \ ____) | |____ / ____ \| |\ | |____ | |
|
||||
|_| |_| |_|_| \_|_/ \_\_____/|______/_/ \_\_| \_|______| |_|
|
||||
_ __ _ _ __ _
|
||||
| |/ /___ _ _ ___ ___| |___ | |/ /___ _ __ _ __ __ _ _ _ __| |___ _ _
|
||||
| ' </ _ \ ' \(_-</ _ \ / -_) | ' </ _ \ ' \| ' \/ _` | ' \/ _` / -_) '_|
|
||||
|_|\_\___/_||_/__/\___/_\___| |_|\_\___/_|_|_|_|_|_\__,_|_||_\__,_\___|_|
|
||||
|
||||
|_|\_\___/_||_/__/\___/_\___| |_|\_\___/_|_|_|_|_|_\__,_|_||_\__,_\___|_|
|
||||
|
||||
Phraseanet Copyright (C) 2004 Alchemy
|
||||
This program comes with ABSOLUTELY NO WARRANTY.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `about:license' for details.\n\n"
|
||||
. ' KONSOLE KOMMANDER', \Alchemy\Phrasea\Core\Version::getName()
|
||||
. ' KONSOLE KOMMANDER', \Alchemy\Phrasea\Core\Version::getName()
|
||||
. ' ' . \Alchemy\Phrasea\Core\Version::getNumber());
|
||||
|
||||
$app->add(new module_console_aboutAuthors('about:authors'));
|
||||
|
67
bin/doctrine
67
bin/doctrine
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @package
|
||||
* @package KonsoleKomander
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
@@ -24,40 +24,39 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Application;
|
||||
use Alchemy\Phrasea;
|
||||
|
||||
require_once dirname(__FILE__) . '/../lib/classes/bootstrap.class.php';
|
||||
$Core = require_once dirname(__FILE__) . '/../lib/bootstrap.php';
|
||||
bootstrap::register_autoloads();
|
||||
|
||||
try
|
||||
{
|
||||
$handler = new \Alchemy\Phrasea\Core\Configuration\Handler(
|
||||
new \Alchemy\Phrasea\Core\Configuration\Application(),
|
||||
new \Alchemy\Phrasea\Core\Configuration\Parser\Yaml()
|
||||
$handler = new \Alchemy\Phrasea\Core\Configuration\Handler(
|
||||
new \Alchemy\Phrasea\Core\Configuration\Application(),
|
||||
new \Alchemy\Phrasea\Core\Configuration\Parser\Yaml()
|
||||
);
|
||||
$configuration = new \Alchemy\Phrasea\Core\Configuration($handler);
|
||||
|
||||
$serviceName = $configuration->getOrm();
|
||||
$confService = $configuration->getService($serviceName);
|
||||
|
||||
if($confService->get("type") !== 'doctrine')
|
||||
if ($confService->get("type") !== 'Orm\\Doctrine')
|
||||
{
|
||||
exit(sprintf("Doctrine is not declared as your ORM but %s is", $confService->get("type")));
|
||||
}
|
||||
|
||||
$ormServiceBuilder = new \Alchemy\Phrasea\Core\ServiceBuilder\Orm(
|
||||
$serviceName
|
||||
, $confService
|
||||
, array('registry' => \registry::get_instance())
|
||||
|
||||
$ormService = \Alchemy\Phrasea\Core\Service\Builder::create(
|
||||
$Core
|
||||
, $serviceName
|
||||
, $confService
|
||||
);
|
||||
|
||||
$ormService = $ormServiceBuilder->buildService();
|
||||
$em = $ormService->getService();
|
||||
$em = $ormService->getDriver();
|
||||
/* @var $em \Doctrine\ORM\EntityManager */
|
||||
|
||||
$app = new Application("Phraseanet Doctrine Console", $ormService->getVersion());
|
||||
$app = new Application("Phraseanet Doctrine Console");
|
||||
|
||||
$helpers = array(
|
||||
'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
|
||||
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
|
||||
'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
|
||||
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
|
||||
);
|
||||
|
||||
$helperSet = $app->getHelperSet();
|
||||
@@ -67,24 +66,24 @@ try
|
||||
}
|
||||
|
||||
$app->addCommands(array(
|
||||
// DBAL Commands
|
||||
new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
|
||||
new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(),
|
||||
// ORM Commands
|
||||
new \Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand(),
|
||||
// DBAL Commands
|
||||
new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
|
||||
new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(),
|
||||
// ORM Commands
|
||||
new \Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(),
|
||||
new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand(),
|
||||
));
|
||||
|
||||
$app->run();
|
||||
|
@@ -453,7 +453,7 @@ class module_console_fileEnsureProductionSetting extends Command
|
||||
}
|
||||
$registry = \registry::get_instance();
|
||||
|
||||
$service = new Core\Service\Builder(
|
||||
$service = Core\Service\Builder::create(
|
||||
\bootstrap::getCore()
|
||||
, $ormName
|
||||
, $configuration
|
||||
|
@@ -823,13 +823,13 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
$serviceName = $configuration->getTemplating();
|
||||
$confService = $configuration->getService($serviceName);
|
||||
|
||||
$templateServiceBuilder = \Alchemy\Phrasea\Core\Service\Builder::create(
|
||||
$templateService = \Alchemy\Phrasea\Core\Service\Builder::create(
|
||||
self::$core,
|
||||
$serviceName
|
||||
, $confService
|
||||
);
|
||||
|
||||
$this->app['Core']["Twig"] = $templateServiceBuilder->getDriver();
|
||||
$this->app['Core']["Twig"] = $templateService->getDriver();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user