Added default implmentation of instanceProvider to GenericArrayObjectTest
authorjeroendedauw <jeroendedauw@gmail.com>
Wed, 29 Aug 2012 17:52:13 +0000 (19:52 +0200)
committerjeroendedauw <jeroendedauw@gmail.com>
Wed, 29 Aug 2012 17:52:13 +0000 (19:52 +0200)
Change-Id: I8d77c03b90ddca226c4bff18e42c53980bf9a861

tests/phpunit/includes/libs/GenericArrayObjectTest.php

index 8a2fb55..70fce11 100644 (file)
@@ -39,22 +39,30 @@ abstract class GenericArrayObjectTest extends MediaWikiTestCase {
        public abstract function elementInstancesProvider();
 
        /**
-        * Provides instances of the concrete class being tested.
+        * Returns the name of the concrete class being tested.
         *
         * @since 1.20
         *
-        * @return array
+        * @return string
         */
-       public abstract function instanceProvider();
+       public abstract function getInstanceClass();
 
        /**
-        * Returns the name of the concrete class being tested.
+        * Provides instances of the concrete class being tested.
         *
         * @since 1.20
         *
-        * @return string
+        * @return array
         */
-       public abstract function getInstanceClass();
+       public function instanceProvider() {
+               $instances = array();
+
+               foreach ( $this->elementInstancesProvider() as $elementInstances ) {
+                       $instances[] = $this->getNew( $elementInstances );
+               }
+
+               return $this->arrayWrap( $instances );
+       }
 
        /**
         * @since 1.20