Krinkle has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/172042

Change subject: test: Apply Sanitizer::decodeCharReferences for clearer tests
......................................................................

test: Apply Sanitizer::decodeCharReferences for clearer tests

These wiktext-isms from the Status object make the tests rather
obfuscated and hard to read/maintain.

Change-Id: I6438c33229ac013489893f8a2241510d9b5a7765
---
M tests/TemplateDataBlobTest.php
1 file changed, 8 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TemplateData 
refs/changes/42/172042/1

diff --git a/tests/TemplateDataBlobTest.php b/tests/TemplateDataBlobTest.php
index d474e2f..ef16ad3 100644
--- a/tests/TemplateDataBlobTest.php
+++ b/tests/TemplateDataBlobTest.php
@@ -274,7 +274,7 @@
                                                }
                                        ]
                                }',
-                               'status' => 'Invalid value for property 
"sets.0.params[1]".'
+                               'status' => 'Invalid value for property 
"sets.0.params[1]".'
                        ),
                        array(
                                'input' => '{
@@ -418,7 +418,9 @@
                // Based on wfMsgExt/parseinline
                $m = array();
                if ( preg_match( '/^<p>(.*)\n?<\/p>\n?$/sU', $str, $m ) ) {
-                       $str = $m[1];
+                       // Unescape char references for things like "[, "]" and 
"|" for
+                       // cleaner test assertions and output
+                       $str = Sanitizer::decodeCharReferences( $m[1] );
                }
                return $str;
        }
@@ -903,7 +905,7 @@
                                        "paramOrder": ["foo", "bar"]
                                }
                                ',
-                               'status' => 'Required property 
"paramOrder&#91;2&#93;" not found.',
+                               'status' => 'Required property "paramOrder[2]" 
not found.',
                                'msg' => 'Incomplete paramOrder'
                        ),
                        array(
@@ -916,7 +918,7 @@
                                        "paramOrder": ["foo", "bar", "baz", 
"quux"]
                                }
                                ',
-                               'status' => 'Invalid value for property 
"paramOrder&#91;3&#93;".',
+                               'status' => 'Invalid value for property 
"paramOrder[3]".',
                                'msg' => 'Unknown params in paramOrder'
                        ),
                        array(
@@ -929,8 +931,8 @@
                                        "paramOrder": ["foo", "bar", "baz", 
"bar"]
                                }
                                ',
-                               'status' => 'Property "paramOrder&#91;3&#93;" 
("bar") is a duplicate of ' .
-                                       '"paramOrder&#91;1&#93;".',
+                               'status' => 'Property "paramOrder[3]" ("bar") 
is a duplicate of ' .
+                                       '"paramOrder[1]".',
                                'msg' => 'Duplicate params in paramOrder'
                        ),
                );

-- 
To view, visit https://gerrit.wikimedia.org/r/172042
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6438c33229ac013489893f8a2241510d9b5a7765
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TemplateData
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to