Aude has uploaded a new change for review.

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

Change subject: Update Wikidata - fix property label constraints bug
......................................................................

Update Wikidata - fix property label constraints bug

Change-Id: I11470dfe9857df6ede788ec7caa7265c95809d47
---
M composer.lock
M extensions/Wikibase/lib/includes/store/sql/TermSqlIndex.php
M extensions/Wikibase/view/tests/phpunit/EntityTermsViewTest.php
M vendor/composer/autoload_files.php
M vendor/composer/installed.json
5 files changed, 104 insertions(+), 115 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata 
refs/changes/43/218343/1

diff --git a/composer.lock b/composer.lock
index 722564d..6e8f08d 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1213,12 +1213,12 @@
             "source": {
                 "type": "git",
                 "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git";,
-                "reference": "80234fc5eab829033478862b2d87fbdb326785b6"
+                "reference": "335f05ba25d402852ef85f2fd17394418c234895"
             },
             "dist": {
                 "type": "zip",
-                "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/80234fc5eab829033478862b2d87fbdb326785b6";,
-                "reference": "80234fc5eab829033478862b2d87fbdb326785b6",
+                "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/335f05ba25d402852ef85f2fd17394418c234895";,
+                "reference": "335f05ba25d402852ef85f2fd17394418c234895",
                 "shasum": ""
             },
             "require": {
@@ -1286,7 +1286,7 @@
                 "wikibaserepo",
                 "wikidata"
             ],
-            "time": "2015-06-08 18:00:35"
+            "time": "2015-06-15 09:45:54"
         },
         {
             "name": "wikibase/wikimedia-badges",
diff --git a/extensions/Wikibase/lib/includes/store/sql/TermSqlIndex.php 
b/extensions/Wikibase/lib/includes/store/sql/TermSqlIndex.php
index 7670782..16bfe90 100644
--- a/extensions/Wikibase/lib/includes/store/sql/TermSqlIndex.php
+++ b/extensions/Wikibase/lib/includes/store/sql/TermSqlIndex.php
@@ -42,7 +42,7 @@
        /**
         * @var int
         */
-       private $maxConflicts = 10;
+       private $maxConflicts = 500;
 
        /**
         * Maps table fields to TermIndex interface field names.
diff --git a/extensions/Wikibase/view/tests/phpunit/EntityTermsViewTest.php 
b/extensions/Wikibase/view/tests/phpunit/EntityTermsViewTest.php
index 958c22e..e06171d 100644
--- a/extensions/Wikibase/view/tests/phpunit/EntityTermsViewTest.php
+++ b/extensions/Wikibase/view/tests/phpunit/EntityTermsViewTest.php
@@ -2,8 +2,8 @@
 
 namespace Wikibase\Test;
 
+use Language;
 use MediaWikiLangTestCase;
-use MessageCache;
 use Wikibase\DataModel\Entity\ItemId;
 use Wikibase\DataModel\Term\Fingerprint;
 use Wikibase\View\EntityTermsView;
@@ -31,20 +31,9 @@
        protected function setUp() {
                parent::setUp();
 
-               $msgCache = MessageCache::singleton();
-               $msgCache->enable();
-
-               // Mocks for all "this is empty" placeholders
-               $msgCache->replace( 'Wikibase-label-empty', '<strong 
class="test">No label</strong>' );
-               $msgCache->replace( 'Wikibase-description-empty', '<strong 
class="test">No description</strong>' );
-               $msgCache->replace( 'Wikibase-aliases-empty', '<strong 
class="test">No aliases</strong>' );
-       }
-
-       protected function tearDown() {
-               $msgCache = MessageCache::singleton();
-               $msgCache->disable();
-
-               parent::tearDown();
+               $this->setMwGlobals( array(
+                       'wgLang' => Language::factory( 'qqx' ),
+               ) );
        }
 
        private function getEntityTermsView( $languageCode = 'en', $called = 
null ) {
@@ -140,17 +129,17 @@
                $noAliases->removeAliasGroup( 'en' );
 
                return array(
-                       array( new Fingerprint(), 'No' ),
-                       array( $noLabel, 'No label' ),
-                       array( $noDescription, 'No description' ),
-                       array( $noAliases, 'No aliases' ),
+                       array( new Fingerprint(), '-empty)' ),
+                       array( $noLabel, '(wikibase-label-empty)' ),
+                       array( $noDescription, '(wikibase-description-empty)' ),
+                       array( $noAliases, '(wikibase-aliases-empty)' ),
                );
        }
 
        /**
         * @dataProvider emptyFingerprintProvider
         */
-       public function testGetHtml_isMarkedAsEmptyValue( Fingerprint 
$fingerprint ) {
+       public function testGetHtml_isMarkedAsEmptyValue( Fingerprint 
$fingerprint, $expectedPlaceholder ) {
                $entityTermsView = $this->getEntityTermsView();
                $html = $entityTermsView->getHtml( $fingerprint, null, '', new 
TextInjector() );
 
@@ -172,7 +161,7 @@
                $html = $entityTermsView->getHtml( $fingerprint, $entityId, '', 
new TextInjector() );
                $idString = $entityId->getSerialization();
 
-               $this->assertContains( '(' . $idString . ')', $html );
+               $this->assertContains( '(parentheses: ' . $idString . ')', 
$html );
                $this->assertContains( '~EDITSECTION~', $html );
        }
 
@@ -180,20 +169,20 @@
                $entityTermsView = $this->getEntityTermsView();
                $html = $entityTermsView->getHtml( new Fingerprint(), null, '', 
new TextInjector() );
 
-               $this->assertNotContains( '(new)', $html );
+               $this->assertNotContains( '(parentheses', $html );
                $this->assertNotContains( '<a ', $html );
        }
 
        /**
         * @dataProvider emptyFingerprintProvider
         */
-       public function testGetHtml_containsIsEmptyPlaceholders( Fingerprint 
$fingerprint, $message ) {
+       public function testGetHtml_containsIsEmptyPlaceholders( Fingerprint 
$fingerprint, $expectedPlaceholder ) {
                $entityTermsView = $this->getEntityTermsView();
                $html = $entityTermsView->getHtml( $fingerprint, null, '', new 
TextInjector() );
 
-               $this->assertContains( $message, $html );
-               $this->assertContains( 'strong', $html, 'make sure the setUp 
works' );
-               $this->assertNotContains( '<strong class="test">', $html );
+               $this->assertContains( $expectedPlaceholder, $html );
+               $numberOfPlaceholders = $fingerprint->isEmpty() ? 3 : 1;
+               $this->assertSame( $numberOfPlaceholders, substr_count( $html, 
$expectedPlaceholder ) );
        }
 
 }
diff --git a/vendor/composer/autoload_files.php 
b/vendor/composer/autoload_files.php
index 06a01a4..980cbe4 100644
--- a/vendor/composer/autoload_files.php
+++ b/vendor/composer/autoload_files.php
@@ -22,6 +22,6 @@
     $baseDir . '/extensions/ValueView/ValueView.php',
     $vendorDir . '/data-values/data-types/DataTypes.php',
     $vendorDir . '/data-values/validators/Validators.php',
-    $baseDir . '/extensions/Wikibase/Wikibase.composer.php',
     $baseDir . '/extensions/WikimediaBadges/WikimediaBadges.php',
+    $baseDir . '/extensions/Wikibase/Wikibase.composer.php',
 );
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index f35039e..1158ef8 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -1197,89 +1197,6 @@
         ]
     },
     {
-        "name": "wikibase/wikibase",
-        "version": "dev-wmf/1.26wmf9",
-        "version_normalized": "dev-wmf/1.26wmf9",
-        "source": {
-            "type": "git",
-            "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git";,
-            "reference": "80234fc5eab829033478862b2d87fbdb326785b6"
-        },
-        "dist": {
-            "type": "zip",
-            "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/80234fc5eab829033478862b2d87fbdb326785b6";,
-            "reference": "80234fc5eab829033478862b2d87fbdb326785b6",
-            "shasum": ""
-        },
-        "require": {
-            "data-values/common": "~0.2.0",
-            "data-values/data-types": "~0.4.0",
-            "data-values/data-values": "~1.0.0",
-            "data-values/geo": "~1.0",
-            "data-values/interfaces": "^0.1.5",
-            "data-values/javascript": "~0.6.0",
-            "data-values/number": "~0.4.0",
-            "data-values/serialization": "~1.0",
-            "data-values/time": "~0.7.0",
-            "data-values/validators": "~0.1.0",
-            "data-values/value-view": "~0.14.0",
-            "diff/diff": "~2.0|~1.0",
-            "php": ">=5.3.2",
-            "wikibase/data-model": "~2.6",
-            "wikibase/data-model-javascript": "~1.0",
-            "wikibase/data-model-serialization": "~1.2",
-            "wikibase/internal-serialization": "~1.3",
-            "wikibase/javascript-api": "~1.0",
-            "wikibase/serialization-javascript": "~2.0"
-        },
-        "conflict": {
-            "mediawiki/mediawiki": "<1.23"
-        },
-        "time": "2015-06-08 18:00:35",
-        "type": "mediawiki-extension",
-        "installation-source": "dist",
-        "autoload": {
-            "files": [
-                "Wikibase.composer.php"
-            ],
-            "classmap": [
-                "client/includes/",
-                "client/WikibaseClient.hooks.php",
-                "client/tests/phpunit/",
-                "lib/includes/",
-                "lib/WikibaseLib.hooks.php",
-                "lib/tests/phpunit/",
-                "repo/includes/",
-                "repo/maintenance/",
-                "repo/tests/phpunit/",
-                "repo/Wikibase.hooks.php"
-            ],
-            "psr-4": {
-                "Wikibase\\View\\": "view/src",
-                "Wikimedia\\Purtle\\": "purtle/src",
-                "Wikimedia\\Purtle\\Tests\\": "purtle/tests/phpunit"
-            }
-        },
-        "notification-url": "https://packagist.org/downloads/";,
-        "license": [
-            "GPL-2.0+"
-        ],
-        "authors": [
-            {
-                "name": "The Wikidata team"
-            }
-        ],
-        "description": "Structured data repository for MediaWiki",
-        "homepage": "http://wikiba.se";,
-        "keywords": [
-            "wikibase",
-            "wikibaseclient",
-            "wikibaselib",
-            "wikibaserepo",
-            "wikidata"
-        ]
-    },
-    {
         "name": "wikibase/wikimedia-badges",
         "version": "dev-master",
         "version_normalized": "9999999-dev",
@@ -1378,5 +1295,88 @@
             "irc": "irc://irc.freenode.net/wikidata",
             "source": "https://github.com/wmde/Wikidata.org/tree/master";
         }
+    },
+    {
+        "name": "wikibase/wikibase",
+        "version": "dev-wmf/1.26wmf9",
+        "version_normalized": "dev-wmf/1.26wmf9",
+        "source": {
+            "type": "git",
+            "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git";,
+            "reference": "335f05ba25d402852ef85f2fd17394418c234895"
+        },
+        "dist": {
+            "type": "zip",
+            "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/335f05ba25d402852ef85f2fd17394418c234895";,
+            "reference": "335f05ba25d402852ef85f2fd17394418c234895",
+            "shasum": ""
+        },
+        "require": {
+            "data-values/common": "~0.2.0",
+            "data-values/data-types": "~0.4.0",
+            "data-values/data-values": "~1.0.0",
+            "data-values/geo": "~1.0",
+            "data-values/interfaces": "^0.1.5",
+            "data-values/javascript": "~0.6.0",
+            "data-values/number": "~0.4.0",
+            "data-values/serialization": "~1.0",
+            "data-values/time": "~0.7.0",
+            "data-values/validators": "~0.1.0",
+            "data-values/value-view": "~0.14.0",
+            "diff/diff": "~2.0|~1.0",
+            "php": ">=5.3.2",
+            "wikibase/data-model": "~2.6",
+            "wikibase/data-model-javascript": "~1.0",
+            "wikibase/data-model-serialization": "~1.2",
+            "wikibase/internal-serialization": "~1.3",
+            "wikibase/javascript-api": "~1.0",
+            "wikibase/serialization-javascript": "~2.0"
+        },
+        "conflict": {
+            "mediawiki/mediawiki": "<1.23"
+        },
+        "time": "2015-06-15 09:45:54",
+        "type": "mediawiki-extension",
+        "installation-source": "dist",
+        "autoload": {
+            "files": [
+                "Wikibase.composer.php"
+            ],
+            "classmap": [
+                "client/includes/",
+                "client/WikibaseClient.hooks.php",
+                "client/tests/phpunit/",
+                "lib/includes/",
+                "lib/WikibaseLib.hooks.php",
+                "lib/tests/phpunit/",
+                "repo/includes/",
+                "repo/maintenance/",
+                "repo/tests/phpunit/",
+                "repo/Wikibase.hooks.php"
+            ],
+            "psr-4": {
+                "Wikibase\\View\\": "view/src",
+                "Wikimedia\\Purtle\\": "purtle/src",
+                "Wikimedia\\Purtle\\Tests\\": "purtle/tests/phpunit"
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/";,
+        "license": [
+            "GPL-2.0+"
+        ],
+        "authors": [
+            {
+                "name": "The Wikidata team"
+            }
+        ],
+        "description": "Structured data repository for MediaWiki",
+        "homepage": "http://wikiba.se";,
+        "keywords": [
+            "wikibase",
+            "wikibaseclient",
+            "wikibaselib",
+            "wikibaserepo",
+            "wikidata"
+        ]
     }
 ]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I11470dfe9857df6ede788ec7caa7265c95809d47
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikidata
Gerrit-Branch: wmf/1.26wmf9
Gerrit-Owner: Aude <aude.w...@gmail.com>

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

Reply via email to