1 | <?php |
---|
2 | |
---|
3 | // Set up environment (include_path, etc.) for running these tests |
---|
4 | define('PHPUnit2_MAIN_METHOD', "don't let PHPUnit try to auto-invoke anything!"); |
---|
5 | |
---|
6 | include_once 'PHPUnit2/TextUI/TestRunner.php'; |
---|
7 | include_once 'PHPUnit2/Framework/TestSuite.php'; |
---|
8 | |
---|
9 | // Probably should use PHING_HOME here instead of assuming that test/ is still subdir. |
---|
10 | ini_set('include_path', realpath(dirname(__FILE__) . '/classes') . PATH_SEPARATOR . realpath(dirname(__FILE__) . '/../classes') . PATH_SEPARATOR . ini_get('include_path')); |
---|
11 | |
---|
12 | define('PHING_TEST_BASE', dirname(__FILE__)); |
---|
13 | |
---|
14 | // STARTUP PHING |
---|
15 | require_once 'phing/Phing.php'; |
---|
16 | |
---|
17 | Phing::startup(); |
---|
18 | |
---|
19 | |
---|
20 | // For now just add all classes to here -- this is ugly, but |
---|
21 | // we don't need to pollute the test structure with AllTest classes |
---|
22 | // yet ... |
---|
23 | |
---|
24 | |
---|
25 | // ---------------------------------------------------------- |
---|
26 | // core |
---|
27 | // ---------------------------------------------------------- |
---|
28 | |
---|
29 | $coreSuite = new PHPUnit2_Framework_TestSuite("Phing Core"); |
---|
30 | include_once 'phing/IntrospectionHelperTest.php'; |
---|
31 | $coreSuite->addTestSuite(new ReflectionClass('IntrospectionHelperTest')); |
---|
32 | |
---|
33 | |
---|
34 | // ---------------------------------------------------------- |
---|
35 | // types |
---|
36 | // ---------------------------------------------------------- |
---|
37 | |
---|
38 | $typesSuite = new PHPUnit2_Framework_TestSuite("Phing Types"); |
---|
39 | |
---|
40 | include_once 'phing/types/MapperTest.php'; |
---|
41 | $typesSuite->addTestSuite(new ReflectionClass('MapperTest')); |
---|
42 | |
---|
43 | include_once 'phing/filters/LineContainsTest.php'; |
---|
44 | $typesSuite->addTestSuite(new ReflectionClass('LineContainsTest')); |
---|
45 | |
---|
46 | include_once 'phing/types/CommandlineTest.php'; |
---|
47 | $typesSuite->addTestSuite(new ReflectionClass('CommandlineTest')); |
---|
48 | |
---|
49 | include_once 'phing/types/FileSetTest.php'; |
---|
50 | $typesSuite->addTestSuite(new ReflectionClass('FileSetTest')); |
---|
51 | |
---|
52 | // ---------------------------------------------------------- |
---|
53 | // tasks |
---|
54 | // ---------------------------------------------------------- |
---|
55 | |
---|
56 | $tasksSuite = new PHPUnit2_Framework_TestSuite("Phing Tasks"); |
---|
57 | |
---|
58 | include_once 'phing/tasks/TypedefTaskTest.php'; |
---|
59 | $tasksSuite->addTestSuite(new ReflectionClass('TypedefTaskTest')); |
---|
60 | |
---|
61 | |
---|
62 | // Conditions |
---|
63 | include_once 'phing/tasks/condition/ContainsConditionTest.php'; |
---|
64 | include_once 'phing/tasks/condition/EqualsConditionTest.php'; |
---|
65 | $tasksSuite->addTestSuite(new ReflectionClass('ContainsConditionTest')); |
---|
66 | $tasksSuite->addTestSuite(new ReflectionClass('EqualsConditionTest')); |
---|
67 | |
---|
68 | include_once 'phing/tasks/PropertyTaskTest.php'; |
---|
69 | $tasksSuite->addTestSuite(new ReflectionClass('PropertyTaskTest')); |
---|
70 | |
---|
71 | |
---|
72 | |
---|
73 | $suite = new PHPUnit2_Framework_TestSuite('Phing Tests'); |
---|
74 | $suite->addTest($coreSuite); |
---|
75 | $suite->addTest($typesSuite); |
---|
76 | $suite->addTest($tasksSuite); |
---|
77 | |
---|
78 | |
---|
79 | |
---|
80 | // Run it! |
---|
81 | PHPUnit2_TextUI_TestRunner::run($suite); |
---|
82 | |
---|
83 | |
---|
84 | // SHUTDOWN PHING |
---|
85 | Phing::shutdown(); |
---|