[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Avoid wfEscapeWikiText on expected values in tests
jenkins-bot has submitted this change and it was merged. 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(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified 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)' => [ - '' . wfEscapeWikiText( 'label [[with]] wikitext' ) . '', + 'wikibase-entityid without sitelink' => [ + 'label [[with]] wikitext', new PropertyValueSnak( new PropertyId( 'P9' ), new EntityIdValue( new ItemId( 'Q12' ) ) ) ], - 'linked wikibase-item (wikibase-entityid)' => [ + 'wikibase-entityid with sitelink' => [ '[[Linked page|This item has a sitelink]]', new PropertyValueSnak( new PropertyId( 'P9' ), @@ -190,21 +190,21 @@ ) ], 'globecoordinate' => [ - wfEscapeWikiText( '12°0\'0"N, 34°0\'0"E' ), + '12°0'0"N, 34°0'0"E', new PropertyValueSnak( new PropertyId( 'P2' ), new GlobeCoordinateValue( new LatLongValue( 12, 34 ), null ) ) ], 'monolingualtext' => [ - wfEscapeWikiText( 'a [[b]] c' ), + 'a [[b]] c', new PropertyValueSnak( new PropertyId( 'P3' ), new MonolingualTextValue( 'es', 'a [[b]] c' ) ) ], 'quantity' => [ - wfEscapeWikiText( '42 a [[b]] c' ), + '42 a [[b]] c', new PropertyValueSnak( $p4, new QuantityValue( @@ -216,7 +216,7 @@ ) ], 'quantity with unit' => [ - wfEscapeWikiText( '42 label [[with]] wikitext' ), + '42 label [[with]] wikitext', new PropertyValueSnak( $p4, new QuantityValue( @@ -228,7 +228,7 @@ ) ], 'string including wikitext' => [ - wfEscapeWikiText( 'a [[b]] c' ), + 'a [[b]] c', new PropertyValueSnak( new PropertyId( 'P5' ), new StringValue( 'a [[b]] c' ) @@ -261,7 +261,7 @@ ) ], 'external-id including wikitext' => [ - wfEscapeWikiText( 'a [[b]] c' ), + 'a [[b]] 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(
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Avoid wfEscapeWikiText on expected values in tests
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)' => [ - '' . wfEscapeWikiText( 'label [[with]] wikitext' ) . '', + 'wikibase-entityid without sitelink' => [ + 'label [[with]] wikitext', new PropertyValueSnak( new PropertyId( 'P9' ), new EntityIdValue( new ItemId( 'Q12' ) ) ) ], - 'linked wikibase-item (wikibase-entityid)' => [ + 'wikibase-entityid with sitelink' => [ '[[Linked page|This item has a sitelink]]', new PropertyValueSnak( new PropertyId( 'P9' ), @@ -190,21 +190,21 @@ ) ], 'globecoordinate' => [ - wfEscapeWikiText( '12°0\'0"N, 34°0\'0"E' ), + '12°0'0"N, 34°0'0"E', new PropertyValueSnak( new PropertyId( 'P2' ), new GlobeCoordinateValue( new LatLongValue( 12, 34 ), null ) ) ], 'monolingualtext' => [ - wfEscapeWikiText( 'a [[b]] c' ), + 'a [[b]] c', new PropertyValueSnak( new PropertyId( 'P3' ), new MonolingualTextValue( 'es', 'a [[b]] c' ) ) ], 'quantity' => [ - wfEscapeWikiText( '42 a [[b]] c' ), + '42 a [[b]] c', new PropertyValueSnak( $p4, new QuantityValue( @@ -216,7 +216,7 @@ ) ], 'quantity with unit' => [ - wfEscapeWikiText( '42 label [[with]] wikitext' ), + '42 label [[with]] wikitext', new PropertyValueSnak( $p4, new QuantityValue( @@ -228,7 +228,7 @@ ) ], 'string including wikitext' => [ - wfEscapeWikiText( 'a [[b]] c' ), + 'a [[b]] c', new PropertyValueSnak( new PropertyId( 'P5' ), new StringValue( 'a [[b]] c' ) @@ -261,7 +261,7 @@ ) ], 'external-id including wikitext' => [ - wfEscapeWikiText( 'a [[b]] c' ), + 'a [[b]] c', new PropertyValueSnak( new PropertyId( 'P8' ), new StringValue( 'a [[b]] c' ) @@ -274,14 +274,14 @@ new StringValue( 'a b c' ) ) ], - 'wikibase-item label (wikibas