aboutsummaryrefslogtreecommitdiff
path: root/tests/prepare.php
blob: 6afc284341a5f102c6e77a14046dca9bdc44e09d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?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
 */
$_SERVER['HTTP_HOST'] = 'http://localhost/';
define('UNIT_TEST_MODE', true);

if ('@data_dir@' == '@' . 'data_dir@') {
    //non pear-install
    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";
}
?>