diff options
author | Yaco <franco@reevo.org> | 2020-06-04 11:01:00 -0300 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2020-06-04 11:01:00 -0300 |
commit | fc7369835258467bf97eb64f184b93691f9a9fd5 (patch) | |
tree | daabd60089d2dd76d9f5fb416b005fbe159c799d /www/wiki/tests/parser/ParserTestResult.php |
first commit
Diffstat (limited to 'www/wiki/tests/parser/ParserTestResult.php')
-rw-r--r-- | www/wiki/tests/parser/ParserTestResult.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/www/wiki/tests/parser/ParserTestResult.php b/www/wiki/tests/parser/ParserTestResult.php new file mode 100644 index 00000000..6396a018 --- /dev/null +++ b/www/wiki/tests/parser/ParserTestResult.php @@ -0,0 +1,44 @@ +<?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 { + /** The test info array */ + public $test; + /** Text that was expected */ + public $expected; + /** 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']; + } +} |