Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Automatically register DataModel tests with MediaWiki
......................................................................

Automatically register DataModel tests with MediaWiki

Change-Id: I769eaa844361f8247637dab97789f874eb172f94
---
M DataModel/DataModel.mw.php
1 file changed, 8 insertions(+), 32 deletions(-)


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

diff --git a/DataModel/DataModel.mw.php b/DataModel/DataModel.mw.php
index 00b549a..adcab48 100644
--- a/DataModel/DataModel.mw.php
+++ b/DataModel/DataModel.mw.php
@@ -59,39 +59,15 @@
  */
 $wgHooks['UnitTestsList'][]    = function( array &$files ) {
        // @codeCoverageIgnoreStart
-       $testFiles = array(
-               'Claim/ClaimAggregate',
-               'Claim/ClaimListAccess',
-               'Claim/Claims',
-               'Claim/Claim',
-               'Claim/Statement',
+       $directoryIterator = new RecursiveDirectoryIterator( __DIR__ . 
'/tests/phpunit/' );
 
-               'Entity/EntityId',
-               'Entity/ItemMultilangTexts',
-               'Entity/ItemNewEmpty',
-               'Entity/ItemNewFromArray',
-               'Entity/Item',
-               'Entity/Property',
-
-               'Snak/PropertyValueSnak',
-               'Snak/SnakList',
-               'Snak/Snak',
-
-               'ByPropertyIdArray',
-               'HashableObjectStorage',
-               'MapValueHasher',
-
-               'ReferenceList',
-               'Reference',
-
-               'SiteLink',
-
-               'hasharray/HashArrayWithoutDuplicates',
-               'hasharray/HashArrayWithDuplicates',
-       );
-
-       foreach ( $testFiles as $file ) {
-               $files[] = __DIR__ . '/tests/phpunit/' . $file . 'Test.php';
+       /**
+        * @var SplFileInfo $fileInfo
+        */
+       foreach ( new RecursiveIteratorIterator( $directoryIterator ) as 
$fileInfo ) {
+               if ( substr( $fileInfo->getFilename(), -8 ) === 'Test.php' ) {
+                       $files[] = $fileInfo->getPathname();
+               }
        }
 
        return true;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I769eaa844361f8247637dab97789f874eb172f94
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