public
Description: PHP5 Unit Testing Framework
Homepage: http://www.snaptest.net
Clone URL: git://github.com/Jakobo/snaptest.git
snaptest / snaptest_webcore.php
100644 49 lines (35 sloc) 1.158 kb
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
40
41
42
43
44
45
46
47
48
49
<?php
 
// snaptest web core initialization
 
// requires PHP 5.2+
if (version_compare(phpversion(), '5.0.0') < 0) {
    echo "\n";
    echo "SnapTest requires a PHP version >= 5.0.0\n";
    exit;
}
 
define('SNAPTEST_CLI_INTERFACE', FALSE);
 
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'constants.php';
 
$options = Snap_Request::getLongOptions(array(
    'mode' => 'index',
    'key' => '',
));
 
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'util' . DIRECTORY_SEPARATOR . 'webfiles' . DIRECTORY_SEPARATOR . 'functions.php';
 
Snap_Request::setURLBase(SNAP_WI_URL_PATH);
 
switch ($options['mode']) {
    case 'index':
        include SNAPTEST_WEBFILES . 'index.php';
        exit;
    
    case 'resource':
        include SNAPTEST_WEBFILES . 'resource.php';
        exit;
    
    case 'getfiles':
        include SNAPTEST_WEBFILES . 'getfiles.php';
        exit;
    
    case 'loadtests':
        include SNAPTEST_WEBFILES . 'loadtests.php';
        exit;
    
    case 'runtest':
        include SNAPTEST_WEBFILES . 'runtest.php';
        exit;
    
    default:
        die('not supported');
}