3 error_reporting(E_ALL
);
5 defined('AK_ENVIRONMENT') ?
null : define('AK_ENVIRONMENT', 'testing');
7 defined('AK_TEST_DIR') ?
null : define('AK_TEST_DIR', str_replace(DIRECTORY_SEPARATOR
.'fixtures'.DIRECTORY_SEPARATOR
.'config'.DIRECTORY_SEPARATOR
.'config.php','',__FILE__
));
10 defined('AK_APP_DIR') ?
null :
11 define('AK_APP_DIR', AK_TEST_DIR
.DIRECTORY_SEPARATOR
.'fixtures'.DIRECTORY_SEPARATOR
.'app');
13 defined('AK_PUBLIC_DIR') ?
null :
14 define('AK_PUBLIC_DIR', AK_TEST_DIR
.DIRECTORY_SEPARATOR
.'fixtures'.DIRECTORY_SEPARATOR
.'public');
16 defined('AK_TEST_HELPERS_DIR') ?
null :
17 define('AK_TEST_HELPERS_DIR', AK_TEST_DIR
.DIRECTORY_SEPARATOR
.'fixtures'.DIRECTORY_SEPARATOR
.'data'.DIRECTORY_SEPARATOR
.'helpers');
19 define('AK_SITE_URL_SUFFIX', str_replace(array(join(DIRECTORY_SEPARATOR
,array_diff((array)@explode
(DIRECTORY_SEPARATOR
,AK_TEST_DIR
),
20 (array)@explode
('/',@$_SERVER['REQUEST_URI']))),DIRECTORY_SEPARATOR
),array('','/'),AK_TEST_DIR
));
22 defined('AK_ENABLE_AKELOS_ARGS') ?
null : define('AK_ENABLE_AKELOS_ARGS', true);
23 //define('AK_SKIP_DB_CONNECTION',isset($db) && $db === false);
24 defined('AK_URL_REWRITE_ENABLED') ?
null : define('AK_URL_REWRITE_ENABLED', true);
26 include_once(substr(AK_TEST_DIR
,0,-5).DIRECTORY_SEPARATOR
.'config'.DIRECTORY_SEPARATOR
.'config.php');
28 defined('AK_APP_LOCALES') ?
null : define('AK_APP_LOCALES', 'en,es');
29 defined('AK_PUBLIC_LOCALES') ?
null : define('AK_PUBLIC_LOCALES', AK_APP_LOCALES
);
30 defined('AK_ACTIVE_RECORD_INTERNATIONALIZE_MODELS_BY_DEFAULT') ?
null : define('AK_ACTIVE_RECORD_INTERNATIONALIZE_MODELS_BY_DEFAULT', true);
31 defined('AK_ACTIVE_RECORD_ENABLE_AUTOMATIC_SETTERS_AND_GETTERS') ?
null : define('AK_ACTIVE_RECORD_ENABLE_AUTOMATIC_SETTERS_AND_GETTERS', true);
33 defined('AK_TESTING_URL') ?
null : define('AK_TESTING_URL', rtrim(AK_URL
,'/').'/test/fixtures/public');
34 defined('AK_TESTING_REWRITE_BASE') ?
null : define('AK_TESTING_REWRITE_BASE', false);
36 defined('AK_LIB_TESTS_DIRECTORY') ?
null : define('AK_LIB_TESTS_DIRECTORY', AK_TEST_DIR
.DS
.'unit'.DS
.'lib');
38 if(AK_TESTING_REWRITE_BASE
){
39 Ak
::file_put_contents(AK_BASE_DIR
.'/test/fixtures/public/.htaccess', str_replace('# RewriteBase /test/fixtures/public','RewriteBase '.AK_TESTING_REWRITE_BASE
, Ak
::file_get_contents(AK_BASE_DIR
.'/test/fixtures/public/.htaccess')));
42 if(defined('AK_TEST_DATABASE_ON')){
43 $default_profile = array_key_exists($argv[count($argv)-1], $database_settings) ?
array_pop($argv) : AK_ENVIRONMENT
;
44 define('AK_DEFAULT_DATABASE_PROFILE', $default_profile);
45 include_once(AK_LIB_DIR
.DS
.'Ak.php');
47 unset($default_profile);
51 require_once(AK_LIB_DIR
.DS
.'AkUnitTest.php');