Merge "Introducing pp_sortkey."
[lhc/web/wiklou.git] / tests / parser / ParserTestResult.php
1 <?php
2 /**
3 * @copyright Copyright © 2013, Antoine Musso
4 * @copyright Copyright © 2013, Wikimedia Foundation Inc.
5 * @license GNU GPL v2
6 *
7 * @file
8 */
9
10 /**
11 * Represent the result of a parser test.
12 *
13 * @since 1.22
14 */
15 class ParserTestResult {
16 /**
17 * Description of the parser test.
18 *
19 * This is usually the text used to describe a parser test in the .txt
20 * files. It is initialized on a construction and you most probably
21 * never want to change it.
22 */
23 public $description;
24 /** Text that was expected */
25 public $expected;
26 /** Actual text rendered */
27 public $actual;
28
29 /**
30 * @param string $description A short text describing the parser test
31 * usually the text in the parser test .txt file. The description
32 * is later available using the property $description.
33 */
34 public function __construct( $description ) {
35 $this->description = $description;
36 }
37
38 /**
39 * Whether the test passed
40 * @return bool
41 */
42 public function isSuccess() {
43 return $this->expected === $this->actual;
44 }
45 }