Merge "docs: Fix typo"
[mediawiki.git] / tests / parser / ParserTestResult.php
blobbe84728987376651b5ca92c1319373b083b3659e
1 <?php
2 /**
3 * @file
5 * @copyright Copyright © 2013, Antoine Musso
6 * @copyright Copyright © 2013, Wikimedia Foundation Inc.
7 */
8 use Wikimedia\Parsoid\ParserTests\Test as ParserTest;
9 use Wikimedia\Parsoid\ParserTests\TestMode as ParserTestMode;
11 /**
12 * Represent the result of a parser test.
14 * @since 1.22
16 class ParserTestResult {
17 /** @var ParserTest The test info */
18 public $test;
19 /** @var ParserTestMode The test mode */
20 public $mode;
21 /** @var string Text that was expected */
22 public $expected;
23 /** @var string Actual text rendered */
24 public $actual;
26 /**
27 * @param ParserTest $test The test info class
28 * @param ParserTestMode $mode The test mode
29 * @param string $expected The normalized expected output
30 * @param string $actual The actual output
32 public function __construct( $test, $mode, $expected, $actual ) {
33 $this->test = $test;
34 $this->mode = $mode;
35 $this->expected = $expected;
36 $this->actual = $actual;
39 /**
40 * Whether the test passed
41 * @return bool
43 public function isSuccess() {
44 return $this->expected === $this->actual;
47 public function getDescription() {
48 return "{$this->test->testName} [{$this->mode}]";