gallery: Fix phan annotation for ImageGalleryBase::getImages
[mediawiki.git] / tests / parser / TestRecorder.php
blob0078452acc0e0e9009831d3ed6a8a12246aa68e3
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.
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.
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
18 * @file
19 * @ingroup Testing
22 use Wikimedia\Parsoid\ParserTests\Test as ParserTest;
23 use Wikimedia\Parsoid\ParserTests\TestMode as ParserTestMode;
25 /**
26 * Interface to record parser test results.
28 * The TestRecorder is a class hierarchy to record the result of
29 * MediaWiki parser tests. One should call start() before running the
30 * full parser tests and end() once all the tests have been finished.
31 * After each test, you should use record() to keep track of your tests
32 * results. Finally, report() is used to generate a summary of your
33 * test run, one could dump it to the console for human consumption or
34 * register the result in a database for tracking purposes.
36 * @since 1.22
38 class TestRecorder {
40 /**
41 * Called at beginning of the parser test run
43 public function start() {
46 /**
47 * Called before starting a test
48 * @param ParserTest $test
49 * @param ParserTestMode $mode
51 public function startTest( ParserTest $test, ParserTestMode $mode ) {
54 /**
55 * Called before starting an input file
56 * @param string $path
58 public function startSuite( string $path ) {
61 /**
62 * Called after ending an input file
63 * @param string $path
65 public function endSuite( string $path ) {
68 /**
69 * Called after each test
70 * @param ParserTestResult $result
72 public function record( ParserTestResult $result ) {
75 /**
76 * Show a warning to the user
77 * @param string $message
79 public function warning( string $message ) {
82 /**
83 * Mark a test skipped
84 * @param ParserTest $test
85 * @param ParserTestMode $mode
86 * @param string $reason
88 public function skipped( ParserTest $test, ParserTestMode $mode, string $reason ) {
91 /**
92 * Called before finishing the test run
94 public function report() {
97 /**
98 * Called at the end of the parser test run
100 public function end() {