SemanticScuttle/tests/prepare.php

41 lines
1.2 KiB
PHP
Raw Permalink Normal View History

<?php
/**
* SemanticScuttle - your social bookmark manager.
*
* PHP version 5.
*
* @category Bookmarking
* @package SemanticScuttle
* @author Benjamin Huynh-Kim-Bang <mensonge@users.sourceforge.net>
* @author Christian Weiske <cweiske@cweiske.de>
* @author Eric Dane <ericdane@users.sourceforge.net>
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
/**
* Prepare the application for unit testing
*/
2011-04-06 05:58:01 +00:00
//that's needed in constants.php
$_SERVER['HTTP_HOST'] = 'http://localhost/';
2011-04-06 05:58:01 +00:00
define('UNIT_TEST_MODE', true);
2010-08-21 23:26:30 +00:00
if ('@data_dir@' == '@' . 'data_dir@') {
//non pear-installation (i.e. git checkout)
2010-08-21 23:26:30 +00:00
require_once dirname(__FILE__) . '/../src/SemanticScuttle/header.php';
} else {
//pear installation; files are in include path
require_once 'SemanticScuttle/header.php';
}
require_once dirname(__FILE__) . '/TestBase.php';
require_once dirname(__FILE__) . '/TestBaseApi.php';
if ($GLOBALS['debugMode'] == true
&& $GLOBALS['dbtype'] == 'mysql4'
) {
echo "\n"
. '!! The combination of debugMode and dbtype==mysql4'
. ' will wreck some tests' . "\n\n";
}
?>