Daniel Kinzler has uploaded a new change for review.

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


Change subject: Fix various issues with test cases.
......................................................................

Fix various issues with test cases.

* Invalid capitalization of class names (fatal error)
* Failure to use @group Datatbase (fatal if no DB is present)
* Make base classes abstract
* Documentation fixes

Change-Id: I918ab013b668a88489d944d4fa55148cbd24c79f
---
M client/tests/phpunit/includes/ChangeHandlerTest.php
M client/tests/phpunit/includes/WikibaseClientTest.php
M repo/tests/phpunit/includes/EntityViewTest.php
M repo/tests/phpunit/includes/api/LangAttributeTestCase.php
M repo/tests/phpunit/includes/api/SetAliasesTest.php
M repo/tests/phpunit/includes/api/SetDescriptionTest.php
M repo/tests/phpunit/includes/api/SetLabelTest.php
M repo/tests/phpunit/includes/serializers/FetchedEntityContentSerializerTest.php
M repo/tests/phpunit/includes/specials/SpecialEntitiesWithoutDescriptionTest.php
M repo/tests/phpunit/includes/specials/SpecialItemByTitleTest.php
M repo/tests/phpunit/includes/specials/SpecialItemDisambiguationTest.php
M repo/tests/phpunit/includes/specials/SpecialItemsWithoutSitelinksTest.php
M repo/tests/phpunit/includes/specials/SpecialNewItemTest.php
M repo/tests/phpunit/includes/specials/SpecialNewPropertyTest.php
M repo/tests/phpunit/includes/specials/SpecialSetAliasesTest.php
M repo/tests/phpunit/includes/specials/SpecialSetDescriptionTest.php
M repo/tests/phpunit/includes/specials/SpecialSetLabelTest.php
M repo/tests/phpunit/includes/specials/SpecialSetSitelinkTest.php
18 files changed, 55 insertions(+), 44 deletions(-)


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

diff --git a/client/tests/phpunit/includes/ChangeHandlerTest.php 
b/client/tests/phpunit/includes/ChangeHandlerTest.php
index 4b21f23..a69f8d3 100644
--- a/client/tests/phpunit/includes/ChangeHandlerTest.php
+++ b/client/tests/phpunit/includes/ChangeHandlerTest.php
@@ -29,6 +29,9 @@
  * @group WikibaseChange
  * @group ChangeHandlerTest
  *
+ * @group Database
+ *        ^---- needed because we rely on Title objects internally
+ *
  * @licence GNU GPL v2+
  * @author Daniel Kinzler
  * @author Jeroen De Dauw < jeroended...@gmail.com >
diff --git a/client/tests/phpunit/includes/WikibaseClientTest.php 
b/client/tests/phpunit/includes/WikibaseClientTest.php
index 1c3f67e..3bfb3f3 100644
--- a/client/tests/phpunit/includes/WikibaseClientTest.php
+++ b/client/tests/phpunit/includes/WikibaseClientTest.php
@@ -34,6 +34,9 @@
  * @group WikibaseClient
  * @group WikibaseClientTest
  *
+ * @group Database
+ *        ^---- needed because we rely on Title objects internally
+ *
  * @licence GNU GPL v2+
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  * @author Daniel Kinzler
diff --git a/repo/tests/phpunit/includes/EntityViewTest.php 
b/repo/tests/phpunit/includes/EntityViewTest.php
index 24fe2e8..05c1465 100644
--- a/repo/tests/phpunit/includes/EntityViewTest.php
+++ b/repo/tests/phpunit/includes/EntityViewTest.php
@@ -34,6 +34,9 @@
  * @group WikibaseRepo
  * @group EntityView
  *
+ * @group Database
+ *        ^---- needed because we rely on Title objects internally
+ *
  * @licence GNU GPL v2+
  * @author H. Snater < mediaw...@snater.com >
  * @author Daniel Kinzler
diff --git a/repo/tests/phpunit/includes/api/LangAttributeTestCase.php 
b/repo/tests/phpunit/includes/api/LangAttributeTestCase.php
index b45f8b9..04f1be3 100644
--- a/repo/tests/phpunit/includes/api/LangAttributeTestCase.php
+++ b/repo/tests/phpunit/includes/api/LangAttributeTestCase.php
@@ -5,53 +5,12 @@
 /**
  * Test case for language attributes API modules.
  *
- * The tests are using "Database" to get its own set of temporal tables.
- * This is nice so we avoid poisoning an existing database.
- *
- * The tests are using "medium" so they are able to run alittle longer before 
they are killed.
- * Without this they will be killed after 1 second, but the setup of the 
tables takes so long
- * time that the first few tests get killed.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @since 0.1
- *
- * @ingroup WikibaseRepoTest
- * @ingroup Test
- *
- * The database group has as a side effect that temporal database tables are 
created. This makes
- * it possible to test without poisoning a production database.
- * @group Database
- *
- * Some of the tests takes more time, and needs therefor longer time before 
they can be aborted
- * as non-functional. The reason why tests are aborted is assumed to be set up 
of temporal databases
- * that hold the first tests in a pending state awaiting access to the 
database.
- * @group medium
- *
- * @group API
- * @group Wikibase
- * @group WikibaseAPI
- * @group LanguageAttributeTest
- * @group BreakingTheSlownessBarrier
+ * @since 0.4
  *
  * @licence GNU GPL v2+
  * @author Adam Shorland
  */
-class LangAttributeTestCase extends WikibaseApiTestCase {
+abstract class LangAttributeTestCase extends WikibaseApiTestCase {
 
        protected static $testAction;
        protected static $testId;
diff --git a/repo/tests/phpunit/includes/api/SetAliasesTest.php 
b/repo/tests/phpunit/includes/api/SetAliasesTest.php
index 85176f9..7896a1e 100644
--- a/repo/tests/phpunit/includes/api/SetAliasesTest.php
+++ b/repo/tests/phpunit/includes/api/SetAliasesTest.php
@@ -49,6 +49,9 @@
  * @group SetAliasesTest
  * @group BreakingTheSlownessBarrier
  *
+ * @group Database
+ *        ^---- needed because we rely on Title objects internally
+ *
  * @licence GNU GPL v2+
  * @author Adam Shorland
  */
diff --git a/repo/tests/phpunit/includes/api/SetDescriptionTest.php 
b/repo/tests/phpunit/includes/api/SetDescriptionTest.php
index 8783eaf..83b260b 100644
--- a/repo/tests/phpunit/includes/api/SetDescriptionTest.php
+++ b/repo/tests/phpunit/includes/api/SetDescriptionTest.php
@@ -49,6 +49,9 @@
  * @group LanguageAttributeTest
  * @group BreakingTheSlownessBarrier
  *
+ * @group Database
+ *        ^---- needed because we rely on Title objects internally
+ *
  * @licence GNU GPL v2+
  * @author Adam Shorland
  */
diff --git a/repo/tests/phpunit/includes/api/SetLabelTest.php 
b/repo/tests/phpunit/includes/api/SetLabelTest.php
index 0cbe02a..dd2483b 100644
--- a/repo/tests/phpunit/includes/api/SetLabelTest.php
+++ b/repo/tests/phpunit/includes/api/SetLabelTest.php
@@ -49,6 +49,9 @@
  * @group LanguageAttributeTest
  * @group BreakingTheSlownessBarrier
  *
+ * @group Database
+ *        ^---- needed because we rely on Title objects internally
+ *
  * @licence GNU GPL v2+
  * @author Adam Shorland
  */
diff --git 
a/repo/tests/phpunit/includes/serializers/FetchedEntityContentSerializerTest.php
 
b/repo/tests/phpunit/includes/serializers/FetchedEntityContentSerializerTest.php
index 2c32dcb..baa7e75 100644
--- 
a/repo/tests/phpunit/includes/serializers/FetchedEntityContentSerializerTest.php
+++ 
b/repo/tests/phpunit/includes/serializers/FetchedEntityContentSerializerTest.php
@@ -19,6 +19,10 @@
  * @group Wikibase
  * @group WikibaseSerialization
  *
+ * @group Database
+ *        ^--- Needed because FetchedEntityContentSerializer uses WikiPage.
+ *             Also because the test uses Title.
+ *
  * @since 0.5
  * @licence GNU GPL v2+
  * @author Daniel Werner < daniel.a.r.wer...@gmail.com >
diff --git 
a/repo/tests/phpunit/includes/specials/SpecialEntitiesWithoutDescriptionTest.php
 
b/repo/tests/phpunit/includes/specials/SpecialEntitiesWithoutDescriptionTest.php
index 93ed381..7040410 100644
--- 
a/repo/tests/phpunit/includes/specials/SpecialEntitiesWithoutDescriptionTest.php
+++ 
b/repo/tests/phpunit/includes/specials/SpecialEntitiesWithoutDescriptionTest.php
@@ -15,6 +15,9 @@
  * @group SpecialPage
  * @group WikibaseSpecialPage
  *
+ * @group Database
+ *        ^---- needed because we rely on Title objects internally
+ *
  * @licence GNU GPL v2+
  * @author Bene* < benestar.wikime...@googlemail.com >
  * @author Adam Shorland
diff --git a/repo/tests/phpunit/includes/specials/SpecialItemByTitleTest.php 
b/repo/tests/phpunit/includes/specials/SpecialItemByTitleTest.php
index 5d93645..d624b31 100644
--- a/repo/tests/phpunit/includes/specials/SpecialItemByTitleTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialItemByTitleTest.php
@@ -15,6 +15,9 @@
  * @group SpecialPage
  * @group WikibaseSpecialPage
  *
+ * @group Database
+ *        ^---- needed because we rely on Title objects internally
+ *
  * @licence GNU GPL v2+
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  * @author Daniel Kinzler
diff --git 
a/repo/tests/phpunit/includes/specials/SpecialItemDisambiguationTest.php 
b/repo/tests/phpunit/includes/specials/SpecialItemDisambiguationTest.php
index b675f80..f7996a7 100644
--- a/repo/tests/phpunit/includes/specials/SpecialItemDisambiguationTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialItemDisambiguationTest.php
@@ -15,6 +15,9 @@
  * @group SpecialPage
  * @group WikibaseSpecialPage
  *
+ * @group Database
+ *        ^---- needed because we rely on Title objects internally
+ *
  * @licence GNU GPL v2+
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  * @author Daniel Kinzler
diff --git 
a/repo/tests/phpunit/includes/specials/SpecialItemsWithoutSitelinksTest.php 
b/repo/tests/phpunit/includes/specials/SpecialItemsWithoutSitelinksTest.php
index 70a8b93..b06b870 100644
--- a/repo/tests/phpunit/includes/specials/SpecialItemsWithoutSitelinksTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialItemsWithoutSitelinksTest.php
@@ -15,6 +15,9 @@
  * @group SpecialPage
  * @group WikibaseSpecialPage
  *
+ * @group Database
+ *        ^---- needed because we rely on Title objects internally
+ *
  * @licence GNU GPL v2+
  * @author Adam Shorland
  */
diff --git a/repo/tests/phpunit/includes/specials/SpecialNewItemTest.php 
b/repo/tests/phpunit/includes/specials/SpecialNewItemTest.php
index a7f2633..c7b529c 100644
--- a/repo/tests/phpunit/includes/specials/SpecialNewItemTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialNewItemTest.php
@@ -15,6 +15,9 @@
  * @group SpecialPage
  * @group WikibaseSpecialPage
  *
+ * @group Database
+ *        ^---- needed because we rely on Title objects internally
+ *
  * @licence GNU GPL v2+
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  * @author Daniel Kinzler
diff --git a/repo/tests/phpunit/includes/specials/SpecialNewPropertyTest.php 
b/repo/tests/phpunit/includes/specials/SpecialNewPropertyTest.php
index f6eb2d0..eb41b7d 100644
--- a/repo/tests/phpunit/includes/specials/SpecialNewPropertyTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialNewPropertyTest.php
@@ -15,6 +15,9 @@
  * @group SpecialPage
  * @group WikibaseSpecialPage
  *
+ * @group Database
+ *        ^---- needed because we rely on Title objects internally
+ *
  * @licence GNU GPL v2+
  * @author John Erling Blad < jeb...@gmail.com >
  * @author Adam Shorland
diff --git a/repo/tests/phpunit/includes/specials/SpecialSetAliasesTest.php 
b/repo/tests/phpunit/includes/specials/SpecialSetAliasesTest.php
index b8058e1..e53776c 100644
--- a/repo/tests/phpunit/includes/specials/SpecialSetAliasesTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialSetAliasesTest.php
@@ -15,6 +15,9 @@
  * @group SpecialPage
  * @group WikibaseSpecialPage
  *
+ * @group Database
+ *        ^---- needed because we rely on Title objects internally
+ *
  * @licence GNU GPL v2+
  * @author John Erling Blad < jeb...@gmail.com >
  */
diff --git a/repo/tests/phpunit/includes/specials/SpecialSetDescriptionTest.php 
b/repo/tests/phpunit/includes/specials/SpecialSetDescriptionTest.php
index ee2780a..4bb581d 100644
--- a/repo/tests/phpunit/includes/specials/SpecialSetDescriptionTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialSetDescriptionTest.php
@@ -15,6 +15,9 @@
  * @group SpecialPage
  * @group WikibaseSpecialPage
  *
+ * @group Database
+ *        ^---- needed because we rely on Title objects internally
+ *
  * @licence GNU GPL v2+
  * @author John Erling Blad < jeb...@gmail.com >
  */
diff --git a/repo/tests/phpunit/includes/specials/SpecialSetLabelTest.php 
b/repo/tests/phpunit/includes/specials/SpecialSetLabelTest.php
index 6e97311..52508de 100644
--- a/repo/tests/phpunit/includes/specials/SpecialSetLabelTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialSetLabelTest.php
@@ -15,6 +15,9 @@
  * @group SpecialPage
  * @group WikibaseSpecialPage
  *
+ * @group Database
+ *        ^---- needed because we rely on Title objects internally
+ *
  * @licence GNU GPL v2+
  * @author John Erling Blad < jeb...@gmail.com >
  */
diff --git a/repo/tests/phpunit/includes/specials/SpecialSetSitelinkTest.php 
b/repo/tests/phpunit/includes/specials/SpecialSetSitelinkTest.php
index a92cd94..fe138dc 100644
--- a/repo/tests/phpunit/includes/specials/SpecialSetSitelinkTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialSetSitelinkTest.php
@@ -15,13 +15,16 @@
  * @group SpecialPage
  * @group WikibaseSpecialPage
  *
+ * @group Database
+ *        ^---- needed because we rely on Title objects internally
+ *
  * @licence GNU GPL v2+
  * @author Adam Shorland
  */
 class SpecialSetSitelinkTest extends SpecialPageTestBase {
 
        protected function newSpecialPage() {
-               return new \Wikibase\Repo\Specials\SpecialSetSitelink();
+               return new \Wikibase\Repo\Specials\SpecialSetSiteLink();
        }
 
        public function testExecute() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I918ab013b668a88489d944d4fa55148cbd24c79f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler <daniel.kinz...@wikimedia.de>

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

Reply via email to