wiki.techinc.nl/tests/parser/ParserTestResult.php
Umherirrender 205f141bb8 Improve some class properties documentation in tests
Change-Id: Id9c9e56865cf9a6bb112be37a5674ec753604fb1
2021-02-02 16:48:15 +00:00

44 lines
925 B
PHP

<?php
/**
* @file
*
* @copyright Copyright © 2013, Antoine Musso
* @copyright Copyright © 2013, Wikimedia Foundation Inc.
*/
/**
* Represent the result of a parser test.
*
* @since 1.22
*/
class ParserTestResult {
/** @var array The test info array */
public $test;
/** @var string Text that was expected */
public $expected;
/** @var string Actual text rendered */
public $actual;
/**
* @param array $test The test info array from TestIterator
* @param string $expected The normalized expected output
* @param string $actual The actual output
*/
public function __construct( $test, $expected, $actual ) {
$this->test = $test;
$this->expected = $expected;
$this->actual = $actual;
}
/**
* Whether the test passed
* @return bool
*/
public function isSuccess() {
return $this->expected === $this->actual;
}
public function getDescription() {
return $this->test['desc'];
}
}