Merge "Add <!DOCTYPE html> to HTML responses"
[lhc/web/wiklou.git] / tests / parser / TestRecorder.php
1 <?php
2 /**
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
17 *
18 * @file
19 * @ingroup Testing
20 */
21
22 /**
23 * Interface to record parser test results.
24 *
25 * The TestRecorder is an class hierarchy to record the result of
26 * MediaWiki parser tests. One should call start() before running the
27 * full parser tests and end() once all the tests have been finished.
28 * After each test, you should use record() to keep track of your tests
29 * results. Finally, report() is used to generate a summary of your
30 * test run, one could dump it to the console for human consumption or
31 * register the result in a database for tracking purposes.
32 *
33 * @since 1.22
34 */
35 class TestRecorder {
36
37 /**
38 * Called at beginning of the parser test run
39 */
40 public function start() {
41 }
42
43 /**
44 * Called before starting a test
45 */
46 public function startTest( $test ) {
47 }
48
49 /**
50 * Called before starting an input file
51 */
52 public function startSuite( $path ) {
53 }
54
55 /**
56 * Called after ending an input file
57 */
58 public function endSuite( $path ) {
59 }
60
61 /**
62 * Called after each test
63 * @param array $test
64 * @param ParserTestResult $result
65 */
66 public function record( $test, ParserTestResult $result ) {
67 }
68
69 /**
70 * Show a warning to the user
71 */
72 public function warning( $message ) {
73 }
74
75 /**
76 * Mark a test skipped
77 */
78 public function skipped( $test, $subtest ) {
79 }
80
81 /**
82 * Called before finishing the test run
83 */
84 public function report() {
85 }
86
87 /**
88 * Called at the end of the parser test run
89 */
90 public function end() {
91 }
92
93 }
94