public function __construct() { AkConfig::setDir('suite', dirname(__FILE__)); $this->rebaseAppPaths(); $this->db = new AkOdbAdapter(); $this->db->connect(array('type' => 'mongo_db', 'database' => 'akelos_testing')); defined('AK_TESTING_MONGO_DB_IS_CONNECTED') || define('AK_TESTING_MONGO_DB_IS_CONNECTED', $this->db->isConnected()); }
public function __construct() { AkConfig::setDir('suite', dirname(__FILE__)); if (!ADMIN_PLUGIN_RUNNING_ON_APPLICATION_SCOPE) { $this->rebaseAppPaths(realpath(dirname(__FILE__) . str_repeat(DS . '..', 3) . DS . 'installer' . DS . 'admin_files')); } AkUnitTestSuite::cleanupTmpDir(); }
public function test_setup() { $original_fixtures = AkConfig::getDir('fixtures'); AkConfig::setDir('fixtures', AkConfig::getDir('suite') . DS . 'fixtures'); $this->uninstallAndInstallMigration('AdminPlugin'); $this->Extension = new Extension(); $this->populateTables('extensions'); AkConfig::setDir('fixtures', $original_fixtures); }
static function rebaseApp($base_path) { static $bases = array(); if ($base_path == false) { if (count($bases) > 1) { $base = array_shift($bases); foreach ($base as $type => $original_path) { AkConfig::setDir($type, $original_path); } return true; } return false; } $bases[] = array('app' => AkConfig::getDir('app'), 'models' => AkConfig::getDir('models'), 'app_installers' => AkConfig::getDir('app_installers'), 'controllers' => AkConfig::getDir('controllers'), 'views' => AkConfig::getDir('views'), 'apis' => AkConfig::getDir('apis'), 'helpers' => AkConfig::getDir('helpers'), 'public' => AkConfig::getDir('public')); AkConfig::setDir('app', $base_path); AkConfig::setDir('app_installers', $base_path . DS . 'installers'); AkConfig::setDir('models', $base_path . DS . 'models'); AkConfig::setDir('controllers', $base_path . DS . 'controllers'); AkConfig::setDir('views', $base_path . DS . 'views'); AkConfig::setDir('apis', $base_path . DS . 'apis'); AkConfig::setDir('helpers', $base_path . DS . 'helpers'); AkConfig::setDir('public', $base_path . DS . 'public'); return true; }
public function __construct() { AkConfig::setDir('suite', dirname(__FILE__)); $this->rebaseAppPaths(); AkUnitTestSuite::cleanupTmpDir(); }
public function restoreAppPaths() { foreach ($this->_original_paths as $type => $original_path) { AkConfig::setDir($type, $original_path); } }
public function __construct() { AkConfig::setDir('suite', realpath(dirname(__FILE__) . '/../../')); $this->rebaseAppPaths(); }