Smutty

MVC Framework

View Code: Smutty_Test_Suite

Browse: All · Classes · Plugins

1
<?php
2
3
include_once 'library/simpletest/unit_tester.php';
4
include_once 'library/simpletest/reporter.php';
5
6
/**
7
* Smutty's subclass of the SimpleTest TestSuite
8
*
9
*/
10
11
class Smutty_Test_Suite extends TestSuite {
12
13
/** directory with test cases */
14
var $testDir;
15
16
/**
17
* constructor
18
*
19
* @param String $testDir directory that holds tests
20
* @return nothing
21
*
22
*/
23
24
function Smutty_Test_Suite( $testDir = 'library/tests' ) {
25
$this->testDir = $testDir;
26
}
27
28
/**
29
* adds a test to the suite
30
*
31
* @param String $name test to add
32
* @return nothing
33
*
34
*/
35
36
function addTest( $name ) {
37
parent::addTestFile( "$this->testDir/$name.php" );
38
}
39
40
/**
41
* runs the test suite
42
*
43
* @return nothing
44
*
45
*/
46
47
function run() {
48
49
parent::run( new TextReporter() );
50
51
}
52
53
}
54
55
?>

The code shown here is the code that is currently running this site. If you want to view the latest SVN version of the code then go to the Subversion repository.