Пример #1
0
 *
 * By default the the environment detector defines the current 
 * environment. But you can force another one using the this var.
 */
$environment = 'phpunit';
/*
 *---------------------------------------------------------------
 * Require CCF
 *---------------------------------------------------------------
 *
 * load the framework file wich wil initialize CCF. 
 */
require_once __DIR__ . "/../framework.php";
/*
 *---------------------------------------------------------------
 * CCUnit resources
 *---------------------------------------------------------------
 *
 * For the unit tests we need some additional resources like
 * controllers, views, ect... 
 */
CCOrbit::enter(COREPATH . 'orbit/CCUnit');
// write header
CCCli::line("==============================\n    _____ _____ ______ \n   / ____/ ____|  ____|\n  | |   | |    | |__   \n  | |   | |    |  __|  \n  | |___| |____| |     \n   \\_____\\_____|_| ramework\n==============================\n", 'cyan');
// complete overwrite of DB configuration
CCConfig::create('database')->_data = CCConfig::create('Core::phpunit/database')->_data;
// delete all database table
DB\Migrator::hard_reset();
DB\Migrator::hard_reset('phpunit');
// run the migrations
DB\Migrator::migrate(true);