-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathharlequin.php
executable file
·59 lines (54 loc) · 1.3 KB
/
harlequin.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?
//
// HARLEQUIN
//
// An automatic testing framework for PHP
//
// https://github.com/popdotco/harelquin/
//
require_once(dirname(__FILE__).'/lib/misc.php');
require_once(dirname(__FILE__).'/lib/recorder.php');
require_once(dirname(__FILE__).'/lib/store.php');
require_once(dirname(__FILE__).'/lib/testplan.php');
require_once(dirname(__FILE__).'/lib/validators.php');
class Harlequin {
// Things you can configure:
static $SKIP_TRACKING_COOKIES = array(
'/^__/',
'/^km_/',
'/^_ga/',
'/^kvcd/',
'/^wcsid/',
'/^_ok/',
'/^hblid/',
'/^olfsk/',
);
static $OUTPUT_COLORS = array(
'success' => '0;37',
'failure' => '1;31;40',
'info' => '',
'notice' => '1;30;40'
);
static $_phpCodePath = __FILE__;
static function record($dir) {
if (!$dir || !file_exists($dir) || !is_writable($dir))
throw new Exception('Harlequin output folder not writable: '.$dir);
HarlequinRecorder::boot($dir);
}
static function invokeCLI($testConfig) {
if (php_sapi_name() == 'cli')
HarlequinRunner::run($testConfig);
}
}
class HarlequinAnsi {
static function color($status) {
return "\033[".Harlequin::$OUTPUT_COLORS[$status].'m';
}
}
class HarlequinRunner {
static function run($testConfig) {
HarlequinTestPlan::run($testConfig);
}
static function configureCurl($testConfig) {
}
}