Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Get rid of bad usage of MediaWikiTestCase in the 
Wikibase\Database component
......................................................................

Get rid of bad usage of MediaWikiTestCase in the Wikibase\Database component

Change-Id: If801e2629b6b0ebf54c66634084d736e2c10a49c
---
M Database/tests/phpunit/FieldDefinitionTest.php
M Database/tests/phpunit/MWDB/ExtendedAbstractionTest.php
M Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
M Database/tests/phpunit/TableBuilderTest.php
M Database/tests/phpunit/TableDefinitionTest.php
5 files changed, 43 insertions(+), 21 deletions(-)


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

diff --git a/Database/tests/phpunit/FieldDefinitionTest.php 
b/Database/tests/phpunit/FieldDefinitionTest.php
index bf8c06c..e00c18e 100644
--- a/Database/tests/phpunit/FieldDefinitionTest.php
+++ b/Database/tests/phpunit/FieldDefinitionTest.php
@@ -34,7 +34,7 @@
  * @licence GNU GPL v2+
  * @author Jeroen De Dauw < [email protected] >
  */
-class FieldDefinitionTest extends \MediaWikiTestCase {
+class FieldDefinitionTest extends \PHPUnit_Framework_TestCase {
 
        public function instanceProvider() {
                $instances = array();
@@ -75,7 +75,13 @@
                        true
                );
 
-               return $this->arrayWrap( $instances );
+               $argLists = array();
+
+               foreach ( $instances as $instance ) {
+                       $argLists[] = array( $instance );
+               }
+
+               return $argLists;
        }
 
        /**
diff --git a/Database/tests/phpunit/MWDB/ExtendedAbstractionTest.php 
b/Database/tests/phpunit/MWDB/ExtendedAbstractionTest.php
index ee8c443..939c664 100644
--- a/Database/tests/phpunit/MWDB/ExtendedAbstractionTest.php
+++ b/Database/tests/phpunit/MWDB/ExtendedAbstractionTest.php
@@ -32,7 +32,7 @@
  * @licence GNU GPL v2+
  * @author Jeroen De Dauw < [email protected] >
  */
-abstract class ExtendedAbstractionTest extends \MediaWikiTestCase {
+abstract class ExtendedAbstractionTest extends \PHPUnit_Framework_TestCase {
 
        /**
         * @return ExtendedAbstraction
@@ -74,7 +74,13 @@
                        new FieldDefinition( 'textfield', 
FieldDefinition::TYPE_TEXT, false ),
                ) );
 
-               return $this->arrayWrap( $tables );
+               $argLists = array();
+
+               foreach ( $tables as $table ) {
+                       $argLists[] = array( $table );
+               }
+
+               return $argLists;
        }
 
        /**
diff --git a/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php 
b/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
index dfb22e4..81d54d1 100644
--- a/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
+++ b/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
@@ -39,7 +39,7 @@
  * @licence GNU GPL v2+
  * @author Jeroen De Dauw < [email protected] >
  */
-class MediaWikiQueryInterfaceTest extends \MediaWikiTestCase {
+class MediaWikiQueryInterfaceTest extends \PHPUnit_Framework_TestCase {
 
        /**
         * @return QueryInterface
@@ -151,7 +151,13 @@
                        new FieldDefinition( 'textfield', 
FieldDefinition::TYPE_TEXT, false ),
                ) );
 
-               return $this->arrayWrap( $tables );
+               $argLists = array();
+
+               foreach ( $tables as $table ) {
+                       $argLists[] = array( $table );
+               }
+
+               return $argLists;
        }
 
        /**
diff --git a/Database/tests/phpunit/TableBuilderTest.php 
b/Database/tests/phpunit/TableBuilderTest.php
index d37dde4..86cb058 100644
--- a/Database/tests/phpunit/TableBuilderTest.php
+++ b/Database/tests/phpunit/TableBuilderTest.php
@@ -37,19 +37,7 @@
  * @licence GNU GPL v2+
  * @author Jeroen De Dauw < [email protected] >
  */
-class TableBuilderTest extends \MediaWikiTestCase {
-
-       public function tableNameProvider() {
-               return $this->arrayWrap(
-                       array(
-                               'foo',
-                               'bar',
-                               'o',
-                               'foo_bar_baz',
-                               'foobarbaz',
-                       )
-               );
-       }
+class TableBuilderTest extends \PHPUnit_Framework_TestCase {
 
        /**
         * @dataProvider tableNameProvider
@@ -73,4 +61,14 @@
                $builder->createTable( $table );
        }
 
+       public function tableNameProvider() {
+               return array(
+                       array( 'foo' ),
+                       array( 'bar' ),
+                       array( 'o' ),
+                       array( 'foo_bar_baz' ),
+                       array( 'foobarbaz ' ),
+               );
+       }
+
 }
diff --git a/Database/tests/phpunit/TableDefinitionTest.php 
b/Database/tests/phpunit/TableDefinitionTest.php
index 3fdb08a..0f94015 100644
--- a/Database/tests/phpunit/TableDefinitionTest.php
+++ b/Database/tests/phpunit/TableDefinitionTest.php
@@ -35,7 +35,7 @@
  * @licence GNU GPL v2+
  * @author Jeroen De Dauw < [email protected] >
  */
-class TableDefinitionTest extends \MediaWikiTestCase {
+class TableDefinitionTest extends \PHPUnit_Framework_TestCase {
 
        public function instanceProvider() {
                $instances = array();
@@ -56,7 +56,13 @@
                        )
                );
 
-               return $this->arrayWrap( $instances );
+               $argLists = array();
+
+               foreach ( $instances as $instance ) {
+                       $argLists[] = array( $instance );
+               }
+
+               return $argLists;
        }
 
        /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If801e2629b6b0ebf54c66634084d736e2c10a49c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to