summaryrefslogtreecommitdiff
path: root/tests/parser/ParserTestResult.php
blob: 7d9415a2b1d4c1c88144bd8ae0151559883cb36e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
 * @copyright Copyright © 2013, Antoine Musso
 * @copyright Copyright © 2013, Wikimedia Foundation Inc.
 * @license GNU GPL v2
 *
 * @file
 */

/**
 * Represent the result of a parser test.
 *
 * @since 1.22
 */
class ParserTestResult {
	/**
	 * Description of the parser test.
	 *
	 * This is usually the text used to describe a parser test in the .txt
	 * files.  It is initialized on a construction and you most probably
	 * never want to change it.
	 */
	public $description;
	/** Text that was expected */
	public $expected;
	/** Actual text rendered */
	public $actual;

	/**
	 * @param string $description A short text describing the parser test
	 *   usually the text in the parser test .txt file.  The description
	 *   is later available using the property $description.
	 */
	public function __construct( $description ) {
		$this->description = $description;
	}

	/**
	 * Whether the test passed
	 * @return bool
	 */
	public function isSuccess() {
		return $this->expected === $this->actual;
	}
}