Exemple #1
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     self::$fixturesDirectory = realpath(dirname(dirname(__DIR__)) . '/fixtures');
     $app = App::create(array('name' => 'Curry Unit Tests', 'adminEmail' => '*****@*****.**', 'cache' => array('method' => 'none'), 'pageCache' => false, 'autoBackup' => false, 'projectPath' => self::$fixturesDirectory, 'migrationVersion' => App::MIGRATION_VERSION, 'template' => array('root' => self::$fixturesDirectory . '/templates', 'options' => array('cache' => false)), 'propel' => array('conf' => self::$fixturesDirectory . '/propel/build/conf/curry-conf.php', 'projectClassPath' => self::$fixturesDirectory . '/propel/build/classes')));
     $app->boot();
     // Empty database
     $con = \Propel::getConnection();
     $con->beginTransaction();
     try {
         foreach (\Curry\Util\Propel::getModels(false) as $model) {
             \PropelQuery::from($model)->deleteAll();
         }
         $con->commit();
     } catch (\Exception $e) {
         $con->rollBack();
         throw $e;
     }
     $setup = new \Curry\Backend\Setup($app);
     $setup->saveConfiguration(array('admin' => array('username' => 'admin', 'password' => 'admin')));
     $app->cache->clean();
 }
<?php

if ($_SERVER['SCRIPT_FILENAME'] !== __FILE__) {
    return false;
}
require __DIR__ . '/../vendor/autoload.php';
\Curry\App::create(__DIR__ . '/../cms/config/config.php')->run();