Beispiel #1
0
 /**
  * @see Model\User      (./tests/dummyModels/user.php)
  * @see Model\Wife      (./tests/dummyModels/wife.php)
  * @see Model\Kid       (./tests/dummyModels/kid.php)
  * @see Model\Job       (./tests/dummyModels/job.php)
  */
 public function setUp()
 {
     Model\User::setUp();
     Model\Wife::setUp();
     Model\Kid::setUp();
     Model\Job::setUp();
     Model\Job\User::setUp();
 }
Beispiel #2
0
 /**
  * @see Gas\Core   (./classes/core.php)
  * @see Model\User (./tests/dummyModels/user.php)
  * @see Model\Wife (./tests/dummyModels/wife.php)
  */
 public function setUp()
 {
     // Prepare some table(s) for test,
     // and connect using related environment
     Model\User::setUp();
     Model\Wife::setUp();
     $this->db = Gas\Core::$db;
 }
Beispiel #3
0
 /**
  * @see Model\User      (./tests/dummyModels/user.php)
  * @see Model\Wife      (./tests/dummyModels/wife.php)
  * @see Model\Role\User (./tests/dummyModels/user.php)
  */
 public function setUp()
 {
     Model\User::setUp();
     Model\Wife::setUp();
     Model\Role\User::setUp();
 }
Beispiel #4
0
$gasdir = implode(DIRECTORY_SEPARATOR, $fragdir);
// Catch Base Directory
if (defined('ROOTPATH')) {
    array_splice($fragdir, -2);
} else {
    array_splice($fragdir, -3);
}
$basedir = implode(DIRECTORY_SEPARATOR, $fragdir);
// Define the PATH and ENVIRONMENT
define('ENVIRONMENT', 'testing');
if (defined('ROOTPATH')) {
    define('APPPATH', $basedir . DIRECTORY_SEPARATOR);
    define('BASEPATH', APPPATH . 'vendor' . DIRECTORY_SEPARATOR . 'CodeIgniter' . DIRECTORY_SEPARATOR . 'system' . DIRECTORY_SEPARATOR);
} else {
    define('APPPATH', $basedir . DIRECTORY_SEPARATOR . 'application' . DIRECTORY_SEPARATOR);
    define('BASEPATH', $basedir . DIRECTORY_SEPARATOR . 'system' . DIRECTORY_SEPARATOR);
}
// Define Gas ORM configuration for unit testing
$config = array('models_path' => array('Model' => __DIR__ . DIRECTORY_SEPARATOR . 'dummyModels'), 'cache_request' => FALSE, 'auto_create_models' => FALSE, 'auto_create_tables' => FALSE);
// Include Gas ORM configuration and Bootstrap
include_once $gasdir . DIRECTORY_SEPARATOR . 'bootstrap.php';
// Initialize all Model's setup
Model\Job\User::setUp();
Model\Role\User::setUp();
Model\Job::setUp();
Model\Kid::setUp();
Model\Role::setUp();
Model\User::setUp();
Model\Wife::setUp();
// Reconnect
Gas\Core::connect(DB_GROUP);