TestRecorder.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. * Interface to record parser test results.
  23. *
  24. * The TestRecorder is an class hierarchy to record the result of
  25. * MediaWiki parser tests. One should call start() before running the
  26. * full parser tests and end() once all the tests have been finished.
  27. * After each test, you should use record() to keep track of your tests
  28. * results. Finally, report() is used to generate a summary of your
  29. * test run, one could dump it to the console for human consumption or
  30. * register the result in a database for tracking purposes.
  31. *
  32. * @since 1.22
  33. */
  34. class TestRecorder {
  35. /**
  36. * Called at beginning of the parser test run
  37. */
  38. public function start() {
  39. }
  40. /**
  41. * Called before starting a test
  42. */
  43. public function startTest( $test ) {
  44. }
  45. /**
  46. * Called before starting an input file
  47. */
  48. public function startSuite( $path ) {
  49. }
  50. /**
  51. * Called after ending an input file
  52. */
  53. public function endSuite( $path ) {
  54. }
  55. /**
  56. * Called after each test
  57. * @param array $test
  58. * @param ParserTestResult $result
  59. */
  60. public function record( $test, ParserTestResult $result ) {
  61. }
  62. /**
  63. * Show a warning to the user
  64. */
  65. public function warning( $message ) {
  66. }
  67. /**
  68. * Mark a test skipped
  69. */
  70. public function skipped( $test, $subtest ) {
  71. }
  72. /**
  73. * Called before finishing the test run
  74. */
  75. public function report() {
  76. }
  77. /**
  78. * Called at the end of the parser test run
  79. */
  80. public function end() {
  81. }
  82. }