Thiemo Mättig (WMDE) has uploaded a new change for review.

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

Change subject: Avoid wfEscapeWikiText on expected values in tests
......................................................................

Avoid wfEscapeWikiText on expected values in tests

I believe this should not be done. The expected output should be a
string, containing the expected output.

This is a direct follow up, fixing the comments I wrote in Ia9e6965.

Change-Id: I9993a1ad17c97681993203ab3444508f622462dc
---
M 
client/tests/phpunit/includes/DataAccess/DataAccessSnakFormatterOutputFormatTest.php
1 file changed, 12 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/76/317476/1

diff --git 
a/client/tests/phpunit/includes/DataAccess/DataAccessSnakFormatterOutputFormatTest.php
 
b/client/tests/phpunit/includes/DataAccess/DataAccessSnakFormatterOutputFormatTest.php
index 22697ac..cc1f205 100644
--- 
a/client/tests/phpunit/includes/DataAccess/DataAccessSnakFormatterOutputFormatTest.php
+++ 
b/client/tests/phpunit/includes/DataAccess/DataAccessSnakFormatterOutputFormatTest.php
@@ -143,14 +143,14 @@
                                        new StringValue( 'a b c' )
                                )
                        ],
-                       'wikibase-item label (wikibase-entityid)' => [
-                               '<span>' . wfEscapeWikiText( 'label [[with]] 
wikitext' ) . '</span>',
+                       'wikibase-entityid without sitelink' => [
+                               '<span>label &#91;&#91;with&#93;&#93; 
wikitext</span>',
                                new PropertyValueSnak(
                                        new PropertyId( 'P9' ),
                                        new EntityIdValue( new ItemId( 'Q12' ) )
                                )
                        ],
-                       'linked wikibase-item (wikibase-entityid)' => [
+                       'wikibase-entityid with sitelink' => [
                                '<span>[[Linked page|This item has a 
sitelink]]</span>',
                                new PropertyValueSnak(
                                        new PropertyId( 'P9' ),
@@ -190,21 +190,21 @@
                                )
                        ],
                        'globecoordinate' => [
-                               wfEscapeWikiText( '12°0\'0"N, 34°0\'0"E' ),
+                               '12°0&#39;0&#34;N, 34°0&#39;0&#34;E',
                                new PropertyValueSnak(
                                        new PropertyId( 'P2' ),
                                        new GlobeCoordinateValue( new 
LatLongValue( 12, 34 ), null )
                                )
                        ],
                        'monolingualtext' => [
-                               wfEscapeWikiText( 'a [[b]] c' ),
+                               'a &#91;&#91;b&#93;&#93; c',
                                new PropertyValueSnak(
                                        new PropertyId( 'P3' ),
                                        new MonolingualTextValue( 'es', 'a 
[[b]] c' )
                                )
                        ],
                        'quantity' => [
-                               wfEscapeWikiText( '42 a [[b]] c' ),
+                               '42 a &#91;&#91;b&#93;&#93; c',
                                new PropertyValueSnak(
                                        $p4,
                                        new QuantityValue(
@@ -216,7 +216,7 @@
                                )
                        ],
                        'quantity with unit' => [
-                               wfEscapeWikiText( '42 label [[with]] wikitext' 
),
+                               '42 label &#91;&#91;with&#93;&#93; wikitext',
                                new PropertyValueSnak(
                                        $p4,
                                        new QuantityValue(
@@ -228,7 +228,7 @@
                                )
                        ],
                        'string including wikitext' => [
-                               wfEscapeWikiText( 'a [[b]] c' ),
+                               'a &#91;&#91;b&#93;&#93; c',
                                new PropertyValueSnak(
                                        new PropertyId( 'P5' ),
                                        new StringValue( 'a [[b]] c' )
@@ -261,7 +261,7 @@
                                )
                        ],
                        'external-id including wikitext' => [
-                               wfEscapeWikiText( 'a [[b]] c' ),
+                               'a &#91;&#91;b&#93;&#93; c',
                                new PropertyValueSnak(
                                        new PropertyId( 'P8' ),
                                        new StringValue( 'a [[b]] c' )
@@ -274,14 +274,14 @@
                                        new StringValue( 'a b c' )
                                )
                        ],
-                       'wikibase-item label (wikibase-entityid)' => [
-                               wfEscapeWikiText( 'label [[with]] wikitext' ),
+                       'wikibase-entityid without sitelink' => [
+                               'label &#91;&#91;with&#93;&#93; wikitext',
                                new PropertyValueSnak(
                                        new PropertyId( 'P9' ),
                                        new EntityIdValue( new ItemId( 'Q12' ) )
                                )
                        ],
-                       'linked wikibase-item (wikibase-entityid)' => [
+                       'wikibase-entityid with sitelink' => [
                                'This item has a sitelink',
                                new PropertyValueSnak(
                                        new PropertyId( 'P9' ),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9993a1ad17c97681993203ab3444508f622462dc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to