Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363894 )

Change subject: Move tests into tests/phpunit and remove UnitTestsList hook
......................................................................

Move tests into tests/phpunit and remove UnitTestsList hook

This takes advantage of extension.json's unit tests autodiscovery
mechanism.

Bug: T142120
Change-Id: Id526f3368fc73ba7e6ef1d793ea70ab05fbd9517
---
M common/Hooks.php
M extension.json
R tests/phpunit/engines/LuaCommon/CommonTest.php
R tests/phpunit/engines/LuaCommon/CommonTests-data-fail1.lua
R tests/phpunit/engines/LuaCommon/CommonTests-data-fail2.lua
R tests/phpunit/engines/LuaCommon/CommonTests-data-fail3.lua
R tests/phpunit/engines/LuaCommon/CommonTests-data-fail4.lua
R tests/phpunit/engines/LuaCommon/CommonTests-data-fail5.lua
R tests/phpunit/engines/LuaCommon/CommonTests-data.lua
R tests/phpunit/engines/LuaCommon/CommonTests-lib.lua
R tests/phpunit/engines/LuaCommon/CommonTests.lua
R tests/phpunit/engines/LuaCommon/HashLibraryTest.php
R tests/phpunit/engines/LuaCommon/HashLibraryTests.lua
R tests/phpunit/engines/LuaCommon/HtmlLibraryTest.php
R tests/phpunit/engines/LuaCommon/HtmlLibraryTests.lua
R tests/phpunit/engines/LuaCommon/LanguageLibraryTest.php
R tests/phpunit/engines/LuaCommon/LanguageLibraryTests.lua
R tests/phpunit/engines/LuaCommon/LibraryUtilTest.php
R tests/phpunit/engines/LuaCommon/LibraryUtilTests.lua
R tests/phpunit/engines/LuaCommon/LuaDataProvider.php
R tests/phpunit/engines/LuaCommon/LuaEngineTestBase.php
R tests/phpunit/engines/LuaCommon/LuaEnvironmentComparisonTest.php
R tests/phpunit/engines/LuaCommon/LuaInterpreterTest.php
R tests/phpunit/engines/LuaCommon/MessageLibraryTest.php
R tests/phpunit/engines/LuaCommon/MessageLibraryTests.lua
R tests/phpunit/engines/LuaCommon/SiteLibraryTest.php
R tests/phpunit/engines/LuaCommon/SiteLibraryTests.lua
R tests/phpunit/engines/LuaCommon/TestFramework.lua
R tests/phpunit/engines/LuaCommon/TextLibraryTest.php
R tests/phpunit/engines/LuaCommon/TextLibraryTests.lua
R tests/phpunit/engines/LuaCommon/TitleLibraryTest.php
R tests/phpunit/engines/LuaCommon/TitleLibraryTests.lua
R tests/phpunit/engines/LuaCommon/UriLibraryTest.php
R tests/phpunit/engines/LuaCommon/UriLibraryTests.lua
R tests/phpunit/engines/LuaCommon/UstringLibraryNormalizationTests.lua
R tests/phpunit/engines/LuaCommon/UstringLibraryPureLuaTest.php
R tests/phpunit/engines/LuaCommon/UstringLibraryTest.php
R tests/phpunit/engines/LuaCommon/UstringLibraryTests.lua
R tests/phpunit/engines/LuaCommon/luaParserTests.txt
R tests/phpunit/engines/LuaSandbox/LuaSandboxInterpreterTest.php
R tests/phpunit/engines/LuaSandbox/SandboxTest.php
R tests/phpunit/engines/LuaSandbox/SandboxTests.lua
R tests/phpunit/engines/LuaStandalone/LuaStandaloneInterpreterTest.php
R tests/phpunit/engines/LuaStandalone/StandaloneTest.php
R tests/phpunit/engines/LuaStandalone/StandaloneTests.lua
45 files changed, 5 insertions(+), 36 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Scribunto 
refs/changes/94/363894/1

diff --git a/common/Hooks.php b/common/Hooks.php
index abfbfa4..63b90cb 100644
--- a/common/Hooks.php
+++ b/common/Hooks.php
@@ -388,36 +388,6 @@
        }
 
        /**
-        * @param array $files
-        * @return bool
-        */
-       public static function unitTestsList( array &$files ) {
-               $tests = [
-                       
'engines/LuaStandalone/LuaStandaloneInterpreterTest.php',
-                       'engines/LuaStandalone/StandaloneTest.php',
-                       'engines/LuaSandbox/LuaSandboxInterpreterTest.php',
-                       'engines/LuaSandbox/SandboxTest.php',
-                       'engines/LuaCommon/LuaEnvironmentComparisonTest.php',
-                       'engines/LuaCommon/CommonTest.php',
-                       'engines/LuaCommon/SiteLibraryTest.php',
-                       'engines/LuaCommon/UriLibraryTest.php',
-                       'engines/LuaCommon/UstringLibraryTest.php',
-                       'engines/LuaCommon/MessageLibraryTest.php',
-                       'engines/LuaCommon/TitleLibraryTest.php',
-                       'engines/LuaCommon/TextLibraryTest.php',
-                       'engines/LuaCommon/HtmlLibraryTest.php',
-                       'engines/LuaCommon/HashLibraryTest.php',
-                       'engines/LuaCommon/LanguageLibraryTest.php',
-                       'engines/LuaCommon/UstringLibraryPureLuaTest.php',
-                       'engines/LuaCommon/LibraryUtilTest.php',
-               ];
-               foreach ( $tests as $test ) {
-                       $files[] = __DIR__ . '/../tests/' . $test;
-               }
-               return true;
-       }
-
-       /**
         * @param Article &$article
         * @param bool &$outputDone
         * @param bool &$pcache
diff --git a/extension.json b/extension.json
index 4f109bc..d04b6ba 100644
--- a/extension.json
+++ b/extension.json
@@ -46,7 +46,7 @@
                "Scribunto_LuaSandboxInterpreter": 
"engines/LuaSandbox/Engine.php",
                "Scribunto_LuaSandboxCallback": "engines/LuaSandbox/Engine.php",
                "Scribunto_LuaStandaloneInterpreterFunction": 
"engines/LuaStandalone/LuaStandaloneEngine.php",
-               "Scribunto_LuaEngineTestSkip": 
"tests/engines/LuaCommon/LuaEngineTestBase.php",
+               "Scribunto_LuaEngineTestSkip": 
"tests/phpunit/engines/LuaCommon/LuaEngineTestBase.php",
                "Scribunto_LuaEngine": "engines/LuaCommon/LuaCommon.php",
                "Scribunto_LuaModule": "engines/LuaCommon/LuaCommon.php",
                "Scribunto_LuaInterpreter": 
"engines/LuaCommon/LuaInterpreter.php",
@@ -54,8 +54,8 @@
                "Scribunto_LuaStandaloneEngine": 
"engines/LuaStandalone/LuaStandaloneEngine.php",
                "Scribunto_LuaStandaloneInterpreter": 
"engines/LuaStandalone/LuaStandaloneEngine.php",
                "Scribunto_LuaLibraryBase": "engines/LuaCommon/LibraryBase.php",
-               "Scribunto_LuaEngineTestBase": 
"tests/engines/LuaCommon/LuaEngineTestBase.php",
-               "Scribunto_LuaDataProvider": 
"tests/engines/LuaCommon/LuaDataProvider.php",
+               "Scribunto_LuaEngineTestBase": 
"tests/phpunit/engines/LuaCommon/LuaEngineTestBase.php",
+               "Scribunto_LuaDataProvider": 
"tests/phpunit/engines/LuaCommon/LuaDataProvider.php",
                "Scribunto_LuaSiteLibrary": "engines/LuaCommon/SiteLibrary.php",
                "Scribunto_LuaUriLibrary": "engines/LuaCommon/UriLibrary.php",
                "Scribunto_LuaUstringLibrary": 
"engines/LuaCommon/UstringLibrary.php",
@@ -114,8 +114,7 @@
                "EditPageBeforeEditButtons": 
"ScribuntoHooks::beforeEditButtons",
                "EditFilterMergedContent": "ScribuntoHooks::validateScript",
                "ArticleViewHeader": "ScribuntoHooks::showDocPageHeader",
-               "ContentHandlerDefaultModelFor": 
"ScribuntoHooks::contentHandlerDefaultModelFor",
-               "UnitTestsList": "ScribuntoHooks::unitTestsList"
+               "ContentHandlerDefaultModelFor": 
"ScribuntoHooks::contentHandlerDefaultModelFor"
        },
        "namespaces": [
                {
@@ -132,7 +131,7 @@
                }
        ],
        "ParserTestFiles": [
-               "tests/engines/LuaCommon/luaParserTests.txt"
+               "tests/phpunit/engines/LuaCommon/luaParserTests.txt"
        ],
        "callback": "ScribuntoHooks::onRegistration",
        "config": {
diff --git a/tests/engines/LuaCommon/CommonTest.php 
b/tests/phpunit/engines/LuaCommon/CommonTest.php
similarity index 100%
rename from tests/engines/LuaCommon/CommonTest.php
rename to tests/phpunit/engines/LuaCommon/CommonTest.php
diff --git a/tests/engines/LuaCommon/CommonTests-data-fail1.lua 
b/tests/phpunit/engines/LuaCommon/CommonTests-data-fail1.lua
similarity index 100%
rename from tests/engines/LuaCommon/CommonTests-data-fail1.lua
rename to tests/phpunit/engines/LuaCommon/CommonTests-data-fail1.lua
diff --git a/tests/engines/LuaCommon/CommonTests-data-fail2.lua 
b/tests/phpunit/engines/LuaCommon/CommonTests-data-fail2.lua
similarity index 100%
rename from tests/engines/LuaCommon/CommonTests-data-fail2.lua
rename to tests/phpunit/engines/LuaCommon/CommonTests-data-fail2.lua
diff --git a/tests/engines/LuaCommon/CommonTests-data-fail3.lua 
b/tests/phpunit/engines/LuaCommon/CommonTests-data-fail3.lua
similarity index 100%
rename from tests/engines/LuaCommon/CommonTests-data-fail3.lua
rename to tests/phpunit/engines/LuaCommon/CommonTests-data-fail3.lua
diff --git a/tests/engines/LuaCommon/CommonTests-data-fail4.lua 
b/tests/phpunit/engines/LuaCommon/CommonTests-data-fail4.lua
similarity index 100%
rename from tests/engines/LuaCommon/CommonTests-data-fail4.lua
rename to tests/phpunit/engines/LuaCommon/CommonTests-data-fail4.lua
diff --git a/tests/engines/LuaCommon/CommonTests-data-fail5.lua 
b/tests/phpunit/engines/LuaCommon/CommonTests-data-fail5.lua
similarity index 100%
rename from tests/engines/LuaCommon/CommonTests-data-fail5.lua
rename to tests/phpunit/engines/LuaCommon/CommonTests-data-fail5.lua
diff --git a/tests/engines/LuaCommon/CommonTests-data.lua 
b/tests/phpunit/engines/LuaCommon/CommonTests-data.lua
similarity index 100%
rename from tests/engines/LuaCommon/CommonTests-data.lua
rename to tests/phpunit/engines/LuaCommon/CommonTests-data.lua
diff --git a/tests/engines/LuaCommon/CommonTests-lib.lua 
b/tests/phpunit/engines/LuaCommon/CommonTests-lib.lua
similarity index 100%
rename from tests/engines/LuaCommon/CommonTests-lib.lua
rename to tests/phpunit/engines/LuaCommon/CommonTests-lib.lua
diff --git a/tests/engines/LuaCommon/CommonTests.lua 
b/tests/phpunit/engines/LuaCommon/CommonTests.lua
similarity index 100%
rename from tests/engines/LuaCommon/CommonTests.lua
rename to tests/phpunit/engines/LuaCommon/CommonTests.lua
diff --git a/tests/engines/LuaCommon/HashLibraryTest.php 
b/tests/phpunit/engines/LuaCommon/HashLibraryTest.php
similarity index 100%
rename from tests/engines/LuaCommon/HashLibraryTest.php
rename to tests/phpunit/engines/LuaCommon/HashLibraryTest.php
diff --git a/tests/engines/LuaCommon/HashLibraryTests.lua 
b/tests/phpunit/engines/LuaCommon/HashLibraryTests.lua
similarity index 100%
rename from tests/engines/LuaCommon/HashLibraryTests.lua
rename to tests/phpunit/engines/LuaCommon/HashLibraryTests.lua
diff --git a/tests/engines/LuaCommon/HtmlLibraryTest.php 
b/tests/phpunit/engines/LuaCommon/HtmlLibraryTest.php
similarity index 100%
rename from tests/engines/LuaCommon/HtmlLibraryTest.php
rename to tests/phpunit/engines/LuaCommon/HtmlLibraryTest.php
diff --git a/tests/engines/LuaCommon/HtmlLibraryTests.lua 
b/tests/phpunit/engines/LuaCommon/HtmlLibraryTests.lua
similarity index 100%
rename from tests/engines/LuaCommon/HtmlLibraryTests.lua
rename to tests/phpunit/engines/LuaCommon/HtmlLibraryTests.lua
diff --git a/tests/engines/LuaCommon/LanguageLibraryTest.php 
b/tests/phpunit/engines/LuaCommon/LanguageLibraryTest.php
similarity index 100%
rename from tests/engines/LuaCommon/LanguageLibraryTest.php
rename to tests/phpunit/engines/LuaCommon/LanguageLibraryTest.php
diff --git a/tests/engines/LuaCommon/LanguageLibraryTests.lua 
b/tests/phpunit/engines/LuaCommon/LanguageLibraryTests.lua
similarity index 100%
rename from tests/engines/LuaCommon/LanguageLibraryTests.lua
rename to tests/phpunit/engines/LuaCommon/LanguageLibraryTests.lua
diff --git a/tests/engines/LuaCommon/LibraryUtilTest.php 
b/tests/phpunit/engines/LuaCommon/LibraryUtilTest.php
similarity index 100%
rename from tests/engines/LuaCommon/LibraryUtilTest.php
rename to tests/phpunit/engines/LuaCommon/LibraryUtilTest.php
diff --git a/tests/engines/LuaCommon/LibraryUtilTests.lua 
b/tests/phpunit/engines/LuaCommon/LibraryUtilTests.lua
similarity index 100%
rename from tests/engines/LuaCommon/LibraryUtilTests.lua
rename to tests/phpunit/engines/LuaCommon/LibraryUtilTests.lua
diff --git a/tests/engines/LuaCommon/LuaDataProvider.php 
b/tests/phpunit/engines/LuaCommon/LuaDataProvider.php
similarity index 100%
rename from tests/engines/LuaCommon/LuaDataProvider.php
rename to tests/phpunit/engines/LuaCommon/LuaDataProvider.php
diff --git a/tests/engines/LuaCommon/LuaEngineTestBase.php 
b/tests/phpunit/engines/LuaCommon/LuaEngineTestBase.php
similarity index 100%
rename from tests/engines/LuaCommon/LuaEngineTestBase.php
rename to tests/phpunit/engines/LuaCommon/LuaEngineTestBase.php
diff --git a/tests/engines/LuaCommon/LuaEnvironmentComparisonTest.php 
b/tests/phpunit/engines/LuaCommon/LuaEnvironmentComparisonTest.php
similarity index 100%
rename from tests/engines/LuaCommon/LuaEnvironmentComparisonTest.php
rename to tests/phpunit/engines/LuaCommon/LuaEnvironmentComparisonTest.php
diff --git a/tests/engines/LuaCommon/LuaInterpreterTest.php 
b/tests/phpunit/engines/LuaCommon/LuaInterpreterTest.php
similarity index 100%
rename from tests/engines/LuaCommon/LuaInterpreterTest.php
rename to tests/phpunit/engines/LuaCommon/LuaInterpreterTest.php
diff --git a/tests/engines/LuaCommon/MessageLibraryTest.php 
b/tests/phpunit/engines/LuaCommon/MessageLibraryTest.php
similarity index 100%
rename from tests/engines/LuaCommon/MessageLibraryTest.php
rename to tests/phpunit/engines/LuaCommon/MessageLibraryTest.php
diff --git a/tests/engines/LuaCommon/MessageLibraryTests.lua 
b/tests/phpunit/engines/LuaCommon/MessageLibraryTests.lua
similarity index 100%
rename from tests/engines/LuaCommon/MessageLibraryTests.lua
rename to tests/phpunit/engines/LuaCommon/MessageLibraryTests.lua
diff --git a/tests/engines/LuaCommon/SiteLibraryTest.php 
b/tests/phpunit/engines/LuaCommon/SiteLibraryTest.php
similarity index 100%
rename from tests/engines/LuaCommon/SiteLibraryTest.php
rename to tests/phpunit/engines/LuaCommon/SiteLibraryTest.php
diff --git a/tests/engines/LuaCommon/SiteLibraryTests.lua 
b/tests/phpunit/engines/LuaCommon/SiteLibraryTests.lua
similarity index 100%
rename from tests/engines/LuaCommon/SiteLibraryTests.lua
rename to tests/phpunit/engines/LuaCommon/SiteLibraryTests.lua
diff --git a/tests/engines/LuaCommon/TestFramework.lua 
b/tests/phpunit/engines/LuaCommon/TestFramework.lua
similarity index 100%
rename from tests/engines/LuaCommon/TestFramework.lua
rename to tests/phpunit/engines/LuaCommon/TestFramework.lua
diff --git a/tests/engines/LuaCommon/TextLibraryTest.php 
b/tests/phpunit/engines/LuaCommon/TextLibraryTest.php
similarity index 100%
rename from tests/engines/LuaCommon/TextLibraryTest.php
rename to tests/phpunit/engines/LuaCommon/TextLibraryTest.php
diff --git a/tests/engines/LuaCommon/TextLibraryTests.lua 
b/tests/phpunit/engines/LuaCommon/TextLibraryTests.lua
similarity index 100%
rename from tests/engines/LuaCommon/TextLibraryTests.lua
rename to tests/phpunit/engines/LuaCommon/TextLibraryTests.lua
diff --git a/tests/engines/LuaCommon/TitleLibraryTest.php 
b/tests/phpunit/engines/LuaCommon/TitleLibraryTest.php
similarity index 100%
rename from tests/engines/LuaCommon/TitleLibraryTest.php
rename to tests/phpunit/engines/LuaCommon/TitleLibraryTest.php
diff --git a/tests/engines/LuaCommon/TitleLibraryTests.lua 
b/tests/phpunit/engines/LuaCommon/TitleLibraryTests.lua
similarity index 100%
rename from tests/engines/LuaCommon/TitleLibraryTests.lua
rename to tests/phpunit/engines/LuaCommon/TitleLibraryTests.lua
diff --git a/tests/engines/LuaCommon/UriLibraryTest.php 
b/tests/phpunit/engines/LuaCommon/UriLibraryTest.php
similarity index 100%
rename from tests/engines/LuaCommon/UriLibraryTest.php
rename to tests/phpunit/engines/LuaCommon/UriLibraryTest.php
diff --git a/tests/engines/LuaCommon/UriLibraryTests.lua 
b/tests/phpunit/engines/LuaCommon/UriLibraryTests.lua
similarity index 100%
rename from tests/engines/LuaCommon/UriLibraryTests.lua
rename to tests/phpunit/engines/LuaCommon/UriLibraryTests.lua
diff --git a/tests/engines/LuaCommon/UstringLibraryNormalizationTests.lua 
b/tests/phpunit/engines/LuaCommon/UstringLibraryNormalizationTests.lua
similarity index 100%
rename from tests/engines/LuaCommon/UstringLibraryNormalizationTests.lua
rename to tests/phpunit/engines/LuaCommon/UstringLibraryNormalizationTests.lua
diff --git a/tests/engines/LuaCommon/UstringLibraryPureLuaTest.php 
b/tests/phpunit/engines/LuaCommon/UstringLibraryPureLuaTest.php
similarity index 100%
rename from tests/engines/LuaCommon/UstringLibraryPureLuaTest.php
rename to tests/phpunit/engines/LuaCommon/UstringLibraryPureLuaTest.php
diff --git a/tests/engines/LuaCommon/UstringLibraryTest.php 
b/tests/phpunit/engines/LuaCommon/UstringLibraryTest.php
similarity index 100%
rename from tests/engines/LuaCommon/UstringLibraryTest.php
rename to tests/phpunit/engines/LuaCommon/UstringLibraryTest.php
diff --git a/tests/engines/LuaCommon/UstringLibraryTests.lua 
b/tests/phpunit/engines/LuaCommon/UstringLibraryTests.lua
similarity index 100%
rename from tests/engines/LuaCommon/UstringLibraryTests.lua
rename to tests/phpunit/engines/LuaCommon/UstringLibraryTests.lua
diff --git a/tests/engines/LuaCommon/luaParserTests.txt 
b/tests/phpunit/engines/LuaCommon/luaParserTests.txt
similarity index 100%
rename from tests/engines/LuaCommon/luaParserTests.txt
rename to tests/phpunit/engines/LuaCommon/luaParserTests.txt
diff --git a/tests/engines/LuaSandbox/LuaSandboxInterpreterTest.php 
b/tests/phpunit/engines/LuaSandbox/LuaSandboxInterpreterTest.php
similarity index 100%
rename from tests/engines/LuaSandbox/LuaSandboxInterpreterTest.php
rename to tests/phpunit/engines/LuaSandbox/LuaSandboxInterpreterTest.php
diff --git a/tests/engines/LuaSandbox/SandboxTest.php 
b/tests/phpunit/engines/LuaSandbox/SandboxTest.php
similarity index 100%
rename from tests/engines/LuaSandbox/SandboxTest.php
rename to tests/phpunit/engines/LuaSandbox/SandboxTest.php
diff --git a/tests/engines/LuaSandbox/SandboxTests.lua 
b/tests/phpunit/engines/LuaSandbox/SandboxTests.lua
similarity index 100%
rename from tests/engines/LuaSandbox/SandboxTests.lua
rename to tests/phpunit/engines/LuaSandbox/SandboxTests.lua
diff --git a/tests/engines/LuaStandalone/LuaStandaloneInterpreterTest.php 
b/tests/phpunit/engines/LuaStandalone/LuaStandaloneInterpreterTest.php
similarity index 100%
rename from tests/engines/LuaStandalone/LuaStandaloneInterpreterTest.php
rename to tests/phpunit/engines/LuaStandalone/LuaStandaloneInterpreterTest.php
diff --git a/tests/engines/LuaStandalone/StandaloneTest.php 
b/tests/phpunit/engines/LuaStandalone/StandaloneTest.php
similarity index 100%
rename from tests/engines/LuaStandalone/StandaloneTest.php
rename to tests/phpunit/engines/LuaStandalone/StandaloneTest.php
diff --git a/tests/engines/LuaStandalone/StandaloneTests.lua 
b/tests/phpunit/engines/LuaStandalone/StandaloneTests.lua
similarity index 100%
rename from tests/engines/LuaStandalone/StandaloneTests.lua
rename to tests/phpunit/engines/LuaStandalone/StandaloneTests.lua

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id526f3368fc73ba7e6ef1d793ea70ab05fbd9517
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Scribunto
Gerrit-Branch: master
Gerrit-Owner: Legoktm <lego...@member.fsf.org>

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

Reply via email to