From: jeroendedauw Date: Wed, 29 Aug 2012 17:52:13 +0000 (+0200) Subject: Added default implmentation of instanceProvider to GenericArrayObjectTest X-Git-Tag: 1.31.0-rc.0~22532^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=4a2e4e569a35d6b277a2b355cbc19595f54a1e27;p=lhc%2Fweb%2Fwiklou.git Added default implmentation of instanceProvider to GenericArrayObjectTest Change-Id: I8d77c03b90ddca226c4bff18e42c53980bf9a861 --- diff --git a/tests/phpunit/includes/libs/GenericArrayObjectTest.php b/tests/phpunit/includes/libs/GenericArrayObjectTest.php index 8a2fb55971..70fce1116d 100644 --- a/tests/phpunit/includes/libs/GenericArrayObjectTest.php +++ b/tests/phpunit/includes/libs/GenericArrayObjectTest.php @@ -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