5 * @copyright Copyright © 2013, Antoine Musso
6 * @copyright Copyright © 2013, Wikimedia Foundation Inc.
8 use Wikimedia\Parsoid\ParserTests\Test
as ParserTest
;
9 use Wikimedia\Parsoid\ParserTests\TestMode
as ParserTestMode
;
12 * Represent the result of a parser test.
16 class ParserTestResult
{
17 /** @var ParserTest The test info */
19 /** @var ParserTestMode The test mode */
21 /** @var string Text that was expected */
23 /** @var string Actual text rendered */
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 ) {
35 $this->expected
= $expected;
36 $this->actual
= $actual;
40 * Whether the test passed
43 public function isSuccess() {
44 return $this->expected
=== $this->actual
;
47 public function getDescription() {
48 return "{$this->test->testName} [{$this->mode}]";