-
Notifications
You must be signed in to change notification settings - Fork 1
/
PreParser.php
34 lines (24 loc) · 899 Bytes
/
PreParser.php
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
<?php
// Test the preparser
namespace BBC;
// Sanitize inputs
require_once 'SanitizeInput.php';
// Include the test file
require_once 'TestBBC.php';
// A lot of functions are shared
require_once 'BBCHelpers.php';
$testBBC = new TestBBC('PreparserTests');
$testBBC->setMessagePath('PreparseMessages.php');
$possible_tests = $testBBC->getPossibleTests();
// We can't set these until we get the possible tests
$input['tests'] = array(
'a' => isset($_GET['a']) && isset($possible_tests[$_GET['a']]) ? $possible_tests[$_GET['a']]['name'] : 'Old preparser',
'b' => isset($_GET['b']) && isset($possible_tests[$_GET['b']]) ? $possible_tests[$_GET['b']]['name'] : 'Preparser',
);
$testBBC->setInput($input);
if (isset($test_types[$type]))
{
call_user_func(array($testBBC, $test_types[$type]), $input);
$results = $testBBC->getResults();
}
require_once 'Templates/IndexTemplate.php';