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

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

Change subject: Fix incomplete ItemDisambiguationTest
......................................................................

Fix incomplete ItemDisambiguationTest

Change-Id: I415a235a7700f34e08718e0a1bc58f181a0cafa2
---
M repo/tests/phpunit/includes/ItemDisambiguationTest.php
1 file changed, 20 insertions(+), 10 deletions(-)


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

diff --git a/repo/tests/phpunit/includes/ItemDisambiguationTest.php 
b/repo/tests/phpunit/includes/ItemDisambiguationTest.php
index 902b68a..b482994 100644
--- a/repo/tests/phpunit/includes/ItemDisambiguationTest.php
+++ b/repo/tests/phpunit/includes/ItemDisambiguationTest.php
@@ -21,14 +21,18 @@
  */
 class ItemDisambiguationTest extends \PHPUnit_Framework_TestCase {
 
-       protected function newItemDisambiguation( $searchLang, $userLang ) {
-               $disambig = new ItemDisambiguation(
-                       $searchLang,
-                       $userLang,
+       /**
+        * @param string $searchLanguageCode
+        * @param string $userLanguageCode
+        *
+        * @return ItemDisambiguation
+        */
+       private function newItemDisambiguation( $searchLanguageCode, 
$userLanguageCode ) {
+               return new ItemDisambiguation(
+                       $searchLanguageCode,
+                       $userLanguageCode,
                        new EntityIdFormatter( new FormatterOptions() )
                );
-
-               return $disambig;
        }
 
        public function getHTMLProvider() {
@@ -47,6 +51,12 @@
 
                $cases = array();
                $matchers = array();
+
+               $matchers['matches'] = array(
+                       'tag' => 'ul',
+                       'content' => '',
+                       'attributes' => array( 'class' => 
'wikibase-disambiguation' ),
+               );
 
                $cases['empty'] = array( 'en', 'en', array(), $matchers );
 
@@ -104,13 +114,13 @@
        /**
         * @dataProvider getHTMLProvider
         */
-       public function testGetHTML( $searchLang, $userLang, $items, $matchers 
) {
-               $disambig = $this->newItemDisambiguation( $searchLang, 
$userLang );
+       public function testGetHTML( $searchLanguageCode, $userLanguageCode, 
array $items, array $matchers ) {
+               $disambig = $this->newItemDisambiguation( $searchLanguageCode, 
$userLanguageCode );
 
                $html = $disambig->getHTML( $items );
 
-               foreach( $matchers as $key => $matcher ) {
-                       $this->assertTag( $matcher, $html, "Failed to match 
html output with tag '{$key}''" );
+               foreach ( $matchers as $key => $matcher ) {
+                       $this->assertTag( $matcher, $html, "Failed to match 
HTML output with tag '{$key}'" );
                }
        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I415a235a7700f34e08718e0a1bc58f181a0cafa2
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