Beispiel #1
0
 public function loadData()
 {
     Doctrine::LoadData(MODELS . '/fixtures/dev');
     $this->loadFiles('Picture');
     $this->loadFiles('File');
     FlashComponent::set('info', 'Load Data terminé.');
     $this->redirect(array('action' => 'index'));
 }
Beispiel #2
0
define('ENV', 'test');
// Bootstrap
$Bootstrap = Bootstrap::getInstance();
$Bootstrap->setEnv(ENV);
$Bootstrap->loadConfigs(ROOT . '/configs/');
$Bootstrap->loadConfigs('../../configs/');
$Bootstrap->addModelPath(ROOT . '/models/bases/');
$Bootstrap->addModelPath(ROOT . '/models/');
$Bootstrap->setDoctrine();
// Drop et recréé la base de tests avec les fixtures
try {
    $Conn = Doctrine_Manager::connection();
    $Conn->dropDatabase();
    $Conn->createDatabase();
    Doctrine::createTablesFromModels(MODELS);
    Doctrine::LoadData(MODELS . 'fixtures/test/');
} catch (Exception $e) {
}
// define('ROOT',           realpath(dirname(__FILE__).'/../../')."/");
// define('CONTROLLERS',    ROOT.'controllers/default/');
// define('VIEWS',      ROOT.'views/default/');
// define('MODELS',         ROOT.'models/');
//
// require_once(ROOT.'_lib/vendors/simpletest/autorun.php');
// require_once ROOT.'_lib/core/_includes.php';
// require_once ROOT.'_lib/vendors/doctrine/Doctrine.php';
//
// // Environnement
// define('ENV', 'test');
//
// // Bootstrap