[TikiWiki-commits] [Git][tikiwiki/tiki][master] [REF] Tests: remove redundant require_once already covered by Composer autoload or plugin system

"Bruno Kambere \(@kambereBr\) via TikiWiki-cvs" <[email protected]> Thu, 16 Jul 2026 18:12:11 +0000
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a591efb4e774_3831ab410613b@gitlab-sidekiq-low-urgency-cpu-bound-v2-77c895df49-rft52.mail>

Bruno Kambere pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
fb050055 by Landry Bitege at 2026-07-16T20:53:54+03:00
[REF] Tests: remove redundant require_once already covered by Composer autoload or plugin system
---
* [REF] Tests: remove redundant require_once already covered by Composer autoload or plugin system

See merge request tikiwiki/tiki!10650

- - - - -


23 changed files:

- lib/test/Core/Connect/ClientTest.php
- lib/test/Core/Reports/ReportsEndToEndTest.php
- lib/test/Core/Reports/SendTest.php
- lib/test/Core/SortModeValidatorTest.php
- lib/test/Core/Tiki/Command/ListExecute/ExecuteTest.php
- lib/test/language/CollectFilesTest.php
- lib/test/language/FileType/PhpTest.php
- lib/test/language/GetStringsEndToEndTest.php
- lib/test/language/GetStringsTest.php
- lib/test/language/LanguageFileTest.php
- lib/test/language/LanguageTest.php
- lib/test/language/LanguageTranslationsTest.php
- lib/test/language/MergeFilesTest.php
- lib/test/language/TranslationSanitizationTest.php
- lib/test/language/WriteFile/FactoryTest.php
- lib/test/language/WriteFileTest.php
- lib/test/performance/PerformanceStatsLibTest.php
- lib/test/wiki-plugins/CodeTest.php
- lib/test/wiki-plugins/TranslationOfTest.php
- lib/test/wiki-plugins/WikiPluginRedirectTest.php
- lib/test/wiki-plugins/WikiPluginWantedPagesTest.php
- lib/test/wiki-plugins/YoutubeTest.php
- lib/test/wiki/WikiLibTest.php


Changes:

=====================================
lib/test/Core/Connect/ClientTest.php
=====================================
@@ -38,7 +38,6 @@ class ConnectClientTest extends TikiTestCase
     {
         global $TWV;
 
-        include_once(__DIR__ . '/../../../setup/twversion.class.php');
         $TWV = new TWVersion();
 
         $data = $this->obj->buildConnectData(); // TODO check status etc


=====================================
lib/test/Core/Reports/ReportsEndToEndTest.php
=====================================
@@ -4,7 +4,6 @@
 //
 // All Rights Reserved. See copyright.txt for details and a complete list of authors.
 // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
-require_once('lib/test/TikiDatabaseTestCase.php');
 
 class Reports_EndToEndTest extends TikiDatabaseTestCase
 {


=====================================
lib/test/Core/Reports/SendTest.php
=====================================
@@ -4,7 +4,6 @@
 //
 // All Rights Reserved. See copyright.txt for details and a complete list of authors.
 // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
-require_once(__DIR__ . '/../../../webmail/tikimaillib.php');
 
 class Reports_SendTest extends TikiTestCase
 {


=====================================
lib/test/Core/SortModeValidatorTest.php
=====================================
@@ -7,8 +7,6 @@ namespace Tiki\Tests\Core;
 use Tiki\SortModeValidator;
 use PHPUnit\Framework\TestCase;
 
-require_once __DIR__ . '/../../core/SortModeValidator.php';
-
 class SortModeValidatorTest extends TestCase
 {
     protected function setUp(): void


=====================================
lib/test/Core/Tiki/Command/ListExecute/ExecuteTest.php
=====================================
@@ -40,8 +40,6 @@ class Tiki_Command_ListExecute_ExecuteTest extends TikiTestCase
 
         parent::setUp();
 
-        require_once(__DIR__ . '/../../../../TestHelpers.php');
-
         $testhelpers->simulateTikiScriptContext();
 
         TikiLib::lib('tiki')->query('TRUNCATE TABLE tiki_plugin_security');


=====================================
lib/test/language/CollectFilesTest.php
=====================================
@@ -4,7 +4,6 @@
 //
 // All Rights Reserved. See copyright.txt for details and a complete list of authors.
 // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
-require_once __DIR__ . '/../../language/CollectFiles.php';
 use org\bovigo\vfs\vfsStream;
 use org\bovigo\vfs\vfsStreamFile;
 use org\bovigo\vfs\vfsStreamDirectory;


=====================================
lib/test/language/FileType/PhpTest.php
=====================================
@@ -4,8 +4,6 @@
 //
 // All Rights Reserved. See copyright.txt for details and a complete list of authors.
 // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
-require_once(__DIR__ . '/../../../language/FileType.php');
-require_once(__DIR__ . '/../../../language/FileType/Php.php');
 
 class Language_FileType_PhpTest extends TikiTestCase
 {


=====================================
lib/test/language/GetStringsEndToEndTest.php
=====================================
@@ -4,12 +4,6 @@
 //
 // All Rights Reserved. See copyright.txt for details and a complete list of authors.
 // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
-require_once(__DIR__ . '/../../language/CollectFiles.php');
-require_once(__DIR__ . '/../../language/WriteFile.php');
-require_once(__DIR__ . '/../../language/GetStrings.php');
-require_once(__DIR__ . '/../../language/FileType.php');
-require_once(__DIR__ . '/../../language/FileType/Php.php');
-require_once(__DIR__ . '/../../language/FileType/Tpl.php');
 use org\bovigo\vfs\vfsStream;
 use org\bovigo\vfs\vfsStreamFile;
 use org\bovigo\vfs\vfsStreamDirectory;


=====================================
lib/test/language/GetStringsTest.php
=====================================
@@ -4,12 +4,6 @@
 //
 // All Rights Reserved. See copyright.txt for details and a complete list of authors.
 // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
-require_once(__DIR__ . '/../../language/CollectFiles.php');
-require_once(__DIR__ . '/../../language/WriteFile.php');
-require_once(__DIR__ . '/../../language/GetStrings.php');
-require_once(__DIR__ . '/../../language/FileType.php');
-require_once(__DIR__ . '/../../language/FileType/Php.php');
-require_once(__DIR__ . '/../../language/FileType/Tpl.php');
 
 use org\bovigo\vfs\vfsStream;
 use org\bovigo\vfs\vfsStreamFile;


=====================================
lib/test/language/LanguageFileTest.php
=====================================
@@ -4,7 +4,6 @@
 //
 // All Rights Reserved. See copyright.txt for details and a complete list of authors.
 // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
-require_once(__DIR__ . '/../../language/File.php');
 
 use org\bovigo\vfs\vfsStream;
 use org\bovigo\vfs\vfsStreamFile;


=====================================
lib/test/language/LanguageTest.php
=====================================
@@ -4,7 +4,6 @@
 //
 // All Rights Reserved. See copyright.txt for details and a complete list of authors.
 // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
-require_once __DIR__ . '/../../language/Language.php';
 
 /**
  * Test class for Language.


=====================================
lib/test/language/LanguageTranslationsTest.php
=====================================
@@ -7,8 +7,6 @@
 
 use Tiki\Cache\CacheLib;
 
-require_once __DIR__ . '/../../language/LanguageTranslations.php';
-
 /**
  * Test class for LanguageTranslations.
  * Generated by PHPUnit on 2010-08-05 at 10:04:14.


=====================================
lib/test/language/MergeFilesTest.php
=====================================
@@ -4,7 +4,6 @@
 //
 // All Rights Reserved. See copyright.txt for details and a complete list of authors.
 // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
-require_once(__DIR__ . '/../../language/MergeFiles.php');
 
 use org\bovigo\vfs\vfsStream;
 use org\bovigo\vfs\vfsStreamFile;


=====================================
lib/test/language/TranslationSanitizationTest.php
=====================================
@@ -244,8 +244,6 @@ $lang = array_replace($lang, $lang_custom);
      */
     public function testSmartyTrBlockEscaping()
     {
-        require_once(__DIR__ . '/../../../lib/smarty_tiki/BlockHandler/Tr.php');
-
         $smarty = \TikiLib::lib('smarty');
         $template = $smarty->createTemplate('eval:dummy');
 
@@ -286,8 +284,6 @@ $lang = array_replace($lang, $lang_custom);
      */
     public function testWikiContextDetection()
     {
-        require_once(__DIR__ . '/../../../lib/smarty_tiki/BlockHandler/Tr.php');
-
         $smarty = \TikiLib::lib('smarty');
         $template = $smarty->createTemplate('eval:dummy');
         $parserlib = \TikiLib::lib('parser');


=====================================
lib/test/language/WriteFile/FactoryTest.php
=====================================
@@ -4,8 +4,6 @@
 //
 // All Rights Reserved. See copyright.txt for details and a complete list of authors.
 // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
-require_once(__DIR__ . '/../../../language/Exception.php');
-require_once(__DIR__ . '/../../../language/WriteFile/Factory.php');
 
 use org\bovigo\vfs\vfsStream;
 use org\bovigo\vfs\vfsStreamFile;


=====================================
lib/test/language/WriteFileTest.php
=====================================
@@ -4,8 +4,6 @@
 //
 // All Rights Reserved. See copyright.txt for details and a complete list of authors.
 // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
-require_once(__DIR__ . '/../../language/Exception.php');
-require_once(__DIR__ . '/../../language/WriteFile.php');
 
 use org\bovigo\vfs\vfsStream;
 use org\bovigo\vfs\vfsStreamFile;


=====================================
lib/test/performance/PerformanceStatsLibTest.php
=====================================
@@ -7,7 +7,6 @@
 
 namespace Tiki\Test\Performance;
 
-require_once 'lib/test/TikiTestCase.php';
 require_once 'lib/performance/performancestatslib.php';
 
 class PerformanceStatsLibTest extends \TikiTestCase


=====================================
lib/test/wiki-plugins/CodeTest.php
=====================================
@@ -4,7 +4,6 @@
 //
 // All Rights Reserved. See copyright.txt for details and a complete list of authors.
 // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
-require_once(__DIR__ . '/../../wiki-plugins/wikiplugin_code.php');
 
 class WikiPlugin_CodeTest extends PHPUnit\Framework\TestCase
 {


=====================================
lib/test/wiki-plugins/TranslationOfTest.php
=====================================
@@ -4,8 +4,6 @@
 //
 // All Rights Reserved. See copyright.txt for details and a complete list of authors.
 // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
-require_once(__DIR__ . '/../../wiki-plugins/wikiplugin_translationof.php');
-require_once(__DIR__ . '/../../test/TestHelpers.php');
 
 class WikiPlugin_TranslationOfTest extends TikiTestCase
 {
@@ -15,9 +13,11 @@ class WikiPlugin_TranslationOfTest extends TikiTestCase
 
     protected function setUp(): void
     {
-        global $user, $prefs;
+        global $user, $prefs, $testhelpers;
         $this->orig_user = $user;
 
+        $testhelpers = new TestHelpers();
+
         $prefs['site_language'] = 'en';
 
 


=====================================
lib/test/wiki-plugins/WikiPluginRedirectTest.php
=====================================
@@ -14,8 +14,6 @@ use Exception;
 use PHPUnit\Framework\TestCase;
 use TikiLib;
 
-require_once(__DIR__ . '/../../wiki-plugins/wikiplugin_redirect.php');
-
 class WikiPluginRedirectTest extends TestCase
 {
     public function testRedirectInPrintMode(): void


=====================================
lib/test/wiki-plugins/WikiPluginWantedPagesTest.php
=====================================
@@ -10,9 +10,6 @@ namespace Tiki\Lib\Test\WikiPlugins;
 use TikiTestCase;
 use TikiLib;
 
-require_once(__DIR__ . '/../../wiki-plugins/wikiplugin_wantedpages.php');
-require_once(__DIR__ . '/../../test/TestHelpers.php');
-
 class WikiPluginWantedPagesTest extends TikiTestCase
 {
     private $orig_user;


=====================================
lib/test/wiki-plugins/YoutubeTest.php
=====================================
@@ -5,8 +5,6 @@
 // All Rights Reserved. See copyright.txt for details and a complete list of authors.
 // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
 
-require_once(__DIR__ . '/../../wiki-plugins/wikiplugin_youtube.php');
-
 class WikiPlugin_YoutubeTest extends PHPUnit\Framework\TestCase
 {
     protected function setUp(): void


=====================================
lib/test/wiki/WikiLibTest.php
=====================================
@@ -22,7 +22,7 @@ class WikiLibTest extends TestCase
     {
         global $testhelpers;
 
-        require_once(__DIR__ . '/../TestHelpers.php');
+        $testhelpers = new \TestHelpers();
         $testhelpers->simulateTikiScriptContext();
 
         require_once(__DIR__ . '/../../../lib/wiki/renderlib.php');



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/fb050055ecda36456feb2c12ff4e827edf9e6142

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/fb050055ecda36456feb2c12ff4e827edf9e6142
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs