diff --git a/.gitignore b/.gitignore index ddd52b8..530a8f1 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ indefero-*.zip src/IDF/conf/path.php .tx/config src/IDF/locale/idf.pot.bak +test/test.db +test/tmp +test/config.php diff --git a/test/bootstrap.php b/test/bootstrap.php index 3cb7f1f..df766f4 100644 --- a/test/bootstrap.php +++ b/test/bootstrap.php @@ -1,7 +1,28 @@ >> setting paths...\n"; define('SRCDIR', realpath(dirname(__FILE__) . '/../src')); define('TESTDIR', dirname(__FILE__)); define('DATADIR', TESTDIR . '/data'); - set_include_path(get_include_path() . PATH_SEPARATOR . SRCDIR); + +$testconfig = require_once $config_file; +if (file_exists($testconfig['db_database'])) { + echo ">>> removing any existing database\n"; + unlink($testconfig['db_database']); +} + +echo ">>> creating empty test database...\n"; +passthru('php ' . PLUF_PATH . '/migrate.php --conf=' . TESTDIR . '/config.php -a -i'); + +echo ">>> setting up web application...\n"; +require 'Pluf.php'; +// for some reason this is nowhere done in Pluf.php +spl_autoload_register('__autoload'); +Pluf::start(TESTDIR . '/config.php'); + diff --git a/test/config.php-dist b/test/config.php-dist new file mode 100644 index 0000000..2e83971 --- /dev/null +++ b/test/config.php-dist @@ -0,0 +1,95 @@ + 'IDF_Scm_Git', + 'svn' => 'IDF_Scm_Svn', + 'mercurial' => 'IDF_Scm_Mercurial', + 'mtn' => 'IDF_Scm_Monotone', +); +# $cfg['git_core_quotepath'] = false; +# $cfg['idf_strong_key_check'] = false; +# $cfg['idf_mimetypes_db'] = '/etc/mime.types'; +# $cfg['idf_extra_text_ext'] = 'ext1 ext2 ext3'; +# $cfg['idf_exec_cmd_prefix'] = '/usr/bin/env -i '; +# $cfg['svn_path'] = 'svn'; +# $cfg['svnlook_path'] = 'svnlook'; +# $cfg['svnadmin_path'] = 'svnadmin'; +# $cfg['hg_path'] = 'hg'; +# $cfg['git_path'] = 'git'; +# $cfg['idf_no_size_check'] = false; + +return $cfg; +