Allow Message::newFromSpecifier to handle ApiMessages
[mediawiki.git] / tests / parser / ParserTestResult.php
bloba7b36721a84caba6a4f38625a4234372f4094ac9
1 <?php
2 /**
3 * @file
5 * @copyright Copyright © 2013, Antoine Musso
6 * @copyright Copyright © 2013, Wikimedia Foundation Inc.
7 */
9 /**
10 * Represent the result of a parser test.
12 * @since 1.22
14 class ParserTestResult {
15 /**
16 * Description of the parser test.
18 * This is usually the text used to describe a parser test in the .txt
19 * files. It is initialized on a construction and you most probably
20 * never want to change it.
22 public $description;
23 /** Text that was expected */
24 public $expected;
25 /** Actual text rendered */
26 public $actual;
28 /**
29 * @param string $description A short text describing the parser test
30 * usually the text in the parser test .txt file. The description
31 * is later available using the property $description.
33 public function __construct( $description ) {
34 $this->description = $description;
37 /**
38 * Whether the test passed
39 * @return bool
41 public function isSuccess() {
42 return $this->expected === $this->actual;