jenkins-bot has submitted this change and it was merged.
Change subject: Add escaping test to EntityTermsViewTest
......................................................................
Add escaping test to EntityTermsViewTest
Test for the fix in Id394493.
I'm not sure if this is worth the trouble. Note that this is pretty
expensive because it creates a temporary page. Is there a better way
to mock a message?
Change-Id: Id5d96d898e86a5d45e52cc4892966a22dbd928c2
---
M view/tests/phpunit/EntityTermsViewTest.php
1 file changed, 14 insertions(+), 1 deletion(-)
Approvals:
Hoo man: Looks good to me, approved
jenkins-bot: Verified
diff --git a/view/tests/phpunit/EntityTermsViewTest.php
b/view/tests/phpunit/EntityTermsViewTest.php
index 60537d8..6dbd9da 100644
--- a/view/tests/phpunit/EntityTermsViewTest.php
+++ b/view/tests/phpunit/EntityTermsViewTest.php
@@ -4,6 +4,7 @@
use Language;
use MediaWikiLangTestCase;
+use MessageCache;
use Wikibase\DataModel\Entity\ItemId;
use Wikibase\DataModel\Term\Fingerprint;
use Wikibase\View\EntityTermsView;
@@ -240,9 +241,21 @@
$this->assertNotContains( '&', $html, 'no double escaping'
);
}
+ public function testGetEntityTermsForLanguageListView_isEscaped() {
+ MessageCache::singleton()->enable();
+ $this->setMwGlobals( 'wgLang', Language::factory( 'en' ) );
+ $this->insertPage(
'MediaWiki:wikibase-entitytermsforlanguagelistview-language', "''RAW''" );
+
+ $view = $this->getEntityTermsView();
+ $html = $view->getEntityTermsForLanguageListView( new
Fingerprint(), array() );
+
+ $this->assertContains( '''RAW''', $html );
+ $this->assertNotContains( "'RAW'", $html );
+ }
+
public function testGetEntityTermsForLanguageListView_isMarkedAsEmpty()
{
$view = $this->getEntityTermsView( 0, 1 );
- $html = $view->getEntityTermsForLanguageListView( new
Fingerprint(), array( 'en' ), null );
+ $html = $view->getEntityTermsForLanguageListView( new
Fingerprint(), array( 'en' ) );
$this->assertContains( 'wb-empty', $html );
$this->assertContains( '(wikibase-label-empty)', $html );
--
To view, visit https://gerrit.wikimedia.org/r/266213
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id5d96d898e86a5d45e52cc4892966a22dbd928c2
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Fomafix
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Ricordisamoa <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits