Repository navigation
Expand file tree
/
Copy pathindex.php
More file actions
128 lines (95 loc) · 2.83 KB
/
Copy pathindex.php
File metadata and controls
128 lines (95 loc) · 2.83 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
/**
* This file implements a simple menu to call the simpletest tests.
*
* @package tests
*/
$action = isset($_GET['action']) ? $_GET['action'] : '';
if( empty($action) && isset($argv[0]) )
{ // CLI
if( isset($argv[1]) )
$action = $argv[1];
else
$action = 'all';
}
require dirname(__FILE__).'/config.php';
if( empty($action) )
{ // display menu:
load_funcs('files/model/_file.funcs.php');
?>
<html>
<head>
<title>b2evolution simpletest framework</title>
<meta name="robots" content="noindex, nofollow" />
</head>
<body>
<h1>b2evolution simpletest framework</h1>
<p style="color:red">SECURITY WARNING: This folder is for developers only and should NOT be part of the distribution and should NOT be uploaded to production servers.</p>
<a href="index.php?action=all"><strong>All tests</strong></a>
<h2>evoCore tests</h2>
<ul>
<li><a href="blogs/"><strong>All evoCore tests</strong></a></li>
<?php
$filenames = get_filenames( dirname(__FILE__).'/blogs', array('inc_dirs'=>false) );
sort($filenames);
foreach( $filenames as $filename )
{
if( substr($filename, -15) != '.simpletest.php' )
continue;
$rel_path = substr($filename, strlen(dirname(__FILE__))+1);
echo '<li><a href="'.$rel_path.'">'.$rel_path.'</a>';
}
?>
</ul>
<h2>Install tests</h2>
<ul>
<li><a href="install/"><strong>All install tests</strong></a></li>
<?php
$filenames = get_filenames( dirname(__FILE__).'/install', array('inc_dirs'=>false) );
sort($filenames);
foreach( $filenames as $filename )
{
if( substr($filename, -15) != '.simpletest.php' )
continue;
$rel_path = substr($filename, strlen(dirname(__FILE__))+1);
echo '<li><a href="'.$rel_path.'">'.$rel_path.'</a>';
}
?>
</ul>
<h2>General tests</h2>
<ul>
<li><a href="general/"><strong>All general tests</strong></a></li>
<?php
$filenames = get_filenames( dirname(__FILE__).'/general', array('inc_dirs'=>false) );
sort($filenames);
foreach( $filenames as $filename )
{
if( substr($filename, -15) != '.simpletest.php' )
continue;
$rel_path = substr($filename, strlen(dirname(__FILE__))+1);
echo '<li><a href="'.$rel_path.'">'.$rel_path.'</a>';
}
?>
</ul>
<p><strong>NOTE: Some tests will create temporary test tables in your database (<?php echo htmlspecialchars($db_config['name'])?>); using the prefix: "<?php echo htmlspecialchars($evo_tests_tableprefix) ?>".</p>
</body>
</html>
<?php
exit;
}
// ACTIONS:
require_once( dirname(__FILE__).'/config.simpletest.php' );
/**
* Our GroupTest
*/
$test = new EvoGroupTest( 'evo Tests Suite');
switch( $action )
{
case 'all':
$test->loadAllTests( dirname(__FILE__).'/blogs/' );
$test->loadAllTests( dirname(__FILE__).'/general/' );
$test->loadAllTests( dirname(__FILE__).'/install' );
break;
}
$test->run( new EvoHtmlReporter(), new EvoTextReporter() );
?>