Merge "Remove .mw-help-field-hint and -data CSS classes from mw.legacy/shared"
[lhc/web/wiklou.git] / tests / parser / ParserTestResult.php
index 7d9415a..6396a01 100644 (file)
@@ -1,10 +1,9 @@
 <?php
 /**
+ * @file
+ *
  * @copyright Copyright © 2013, Antoine Musso
  * @copyright Copyright © 2013, Wikimedia Foundation Inc.
- * @license GNU GPL v2
- *
- * @file
  */
 
 /**
  * @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;
+       /** The test info array */
+       public $test;
        /** Text that was expected */
        public $expected;
        /** Actual text rendered */
        public $actual;
 
        /**
-        * @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.
+        * @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( $description ) {
-               $this->description = $description;
+       public function __construct( $test, $expected, $actual ) {
+               $this->test = $test;
+               $this->expected = $expected;
+               $this->actual = $actual;
        }
 
        /**
@@ -42,4 +37,8 @@ class ParserTestResult {
        public function isSuccess() {
                return $this->expected === $this->actual;
        }
+
+       public function getDescription() {
+               return $this->test['desc'];
+       }
 }