2013-03-19 14:00:44 +00:00
|
|
|
<?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;
|
|
|
|
|
|
|
|
|
|
/**
|
2014-04-17 18:43:42 +00:00
|
|
|
* @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.
|
2013-03-19 14:00:44 +00:00
|
|
|
*/
|
|
|
|
|
public function __construct( $description ) {
|
|
|
|
|
$this->description = $description;
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-15 20:13:54 +00:00
|
|
|
/**
|
|
|
|
|
* Whether the test passed
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
2013-03-19 14:00:44 +00:00
|
|
|
public function isSuccess() {
|
2013-04-27 11:23:52 +00:00
|
|
|
return $this->expected === $this->actual;
|
2013-03-19 14:00:44 +00:00
|
|
|
}
|
|
|
|
|
}
|