From 8f60e1206e45e67c96a7630d4ff94e72fe875f09 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 26 Sep 2020 15:08:39 +0200 Subject: [PATCH] Comply with PHPUnit V8: setup/teardown functions must return void --- tests/ApplicationUtilsTest.php | 4 ++-- tests/FileUtilsTest.php | 2 +- tests/HistoryTest.php | 2 +- tests/LanguagesTest.php | 2 +- tests/ThumbnailerTest.php | 4 ++-- tests/TimeZoneTest.php | 2 +- tests/UtilsTest.php | 6 +++--- tests/api/ApiMiddlewareTest.php | 4 ++-- tests/api/ApiUtilsTest.php | 2 +- tests/api/controllers/history/HistoryTest.php | 4 ++-- tests/api/controllers/info/InfoTest.php | 4 ++-- tests/api/controllers/links/DeleteLinkTest.php | 4 ++-- tests/api/controllers/links/GetLinkIdTest.php | 4 ++-- tests/api/controllers/links/GetLinksTest.php | 4 ++-- tests/api/controllers/links/PostLinkTest.php | 4 ++-- tests/api/controllers/links/PutLinkTest.php | 4 ++-- tests/api/controllers/tags/DeleteTagTest.php | 4 ++-- tests/api/controllers/tags/GetTagNameTest.php | 4 ++-- tests/api/controllers/tags/GetTagsTest.php | 4 ++-- tests/api/controllers/tags/PutTagTest.php | 4 ++-- tests/bookmark/BookmarkFileServiceTest.php | 2 +- tests/config/ConfigJsonTest.php | 2 +- tests/config/ConfigManagerTest.php | 2 +- tests/config/ConfigPhpTest.php | 2 +- tests/feed/CachedPageTest.php | 4 ++-- tests/formatter/BookmarkDefaultFormatterTest.php | 2 +- tests/formatter/BookmarkMarkdownFormatterTest.php | 2 +- tests/formatter/BookmarkRawFormatterTest.php | 2 +- tests/formatter/FormatterFactoryTest.php | 2 +- tests/languages/fr/LanguagesFrTest.php | 4 ++-- tests/legacy/LegacyLinkDBTest.php | 2 +- tests/legacy/LegacyLinkFilterTest.php | 2 +- tests/legacy/LegacyUpdaterTest.php | 4 ++-- tests/netscape/BookmarkExportTest.php | 2 +- tests/netscape/BookmarkImportTest.php | 8 ++++---- tests/plugins/PluginAddlinkTest.php | 2 +- tests/plugins/PluginDefaultColorsTest.php | 4 ++-- tests/plugins/PluginPlayvideosTest.php | 2 +- tests/plugins/PluginPubsubhubbubTest.php | 2 +- tests/plugins/PluginQrcodeTest.php | 2 +- tests/plugins/PluginWallabagTest.php | 2 +- tests/plugins/WallabagInstanceTest.php | 2 +- tests/render/PageCacheManagerTest.php | 4 ++-- tests/security/BanManagerTest.php | 2 +- tests/security/LoginManagerTest.php | 2 +- tests/security/SessionManagerTest.php | 4 ++-- tests/updater/UpdaterTest.php | 2 +- 47 files changed, 72 insertions(+), 72 deletions(-) diff --git a/tests/ApplicationUtilsTest.php b/tests/ApplicationUtilsTest.php index 15388970..57359196 100644 --- a/tests/ApplicationUtilsTest.php +++ b/tests/ApplicationUtilsTest.php @@ -17,7 +17,7 @@ class ApplicationUtilsTest extends \PHPUnit\Framework\TestCase /** * Reset test data for each test */ - public function setUp() + protected function setUp(): void { FakeApplicationUtils::$VERSION_CODE = ''; if (file_exists(self::$testUpdateFile)) { @@ -28,7 +28,7 @@ class ApplicationUtilsTest extends \PHPUnit\Framework\TestCase /** * Remove test version file if it exists */ - public function tearDown() + protected function tearDown(): void { if (is_file('sandbox/version.php')) { unlink('sandbox/version.php'); diff --git a/tests/FileUtilsTest.php b/tests/FileUtilsTest.php index 57719175..eb9cb89a 100644 --- a/tests/FileUtilsTest.php +++ b/tests/FileUtilsTest.php @@ -19,7 +19,7 @@ class FileUtilsTest extends \PHPUnit\Framework\TestCase /** * Delete test file after every test. */ - public function tearDown() + protected function tearDown(): void { @unlink(self::$file); } diff --git a/tests/HistoryTest.php b/tests/HistoryTest.php index 7189c3a9..e9e61032 100644 --- a/tests/HistoryTest.php +++ b/tests/HistoryTest.php @@ -16,7 +16,7 @@ class HistoryTest extends \PHPUnit\Framework\TestCase /** * Delete history file. */ - public function setUp() + protected function setUp(): void { if (file_exists(self::$historyFilePath)) { unlink(self::$historyFilePath); diff --git a/tests/LanguagesTest.php b/tests/LanguagesTest.php index de83f291..914179c8 100644 --- a/tests/LanguagesTest.php +++ b/tests/LanguagesTest.php @@ -22,7 +22,7 @@ class LanguagesTest extends \PHPUnit\Framework\TestCase /** * */ - public function setUp() + protected function setUp(): void { $this->conf = new ConfigManager(self::$configFile); } diff --git a/tests/ThumbnailerTest.php b/tests/ThumbnailerTest.php index c01849f7..5b6d6a4d 100644 --- a/tests/ThumbnailerTest.php +++ b/tests/ThumbnailerTest.php @@ -30,7 +30,7 @@ class ThumbnailerTest extends TestCase */ protected $conf; - public function setUp() + protected function setUp(): void { $this->conf = new ConfigManager('tests/utils/config/configJson'); $this->conf->set('thumbnails.mode', Thumbnailer::MODE_ALL); @@ -43,7 +43,7 @@ class ThumbnailerTest extends TestCase WTConfigManager::addFile('tests/utils/config/wt.json'); } - public function tearDown() + protected function tearDown(): void { $this->rrmdirContent('sandbox/'); } diff --git a/tests/TimeZoneTest.php b/tests/TimeZoneTest.php index 02bf060f..d3d9aeeb 100644 --- a/tests/TimeZoneTest.php +++ b/tests/TimeZoneTest.php @@ -15,7 +15,7 @@ class TimeZoneTest extends PHPUnit\Framework\TestCase */ protected $installedTimezones; - public function setUp() + protected function setUp(): void { $this->installedTimezones = [ 'Antarctica/Syowa', diff --git a/tests/UtilsTest.php b/tests/UtilsTest.php index 26d2a6b8..93b77539 100644 --- a/tests/UtilsTest.php +++ b/tests/UtilsTest.php @@ -26,7 +26,7 @@ class UtilsTest extends PHPUnit\Framework\TestCase /** * Assign reference data */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { self::$defaultTimeZone = date_default_timezone_get(); // Timezone without DST for test consistency @@ -36,7 +36,7 @@ class UtilsTest extends PHPUnit\Framework\TestCase /** * Reset the timezone */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { date_default_timezone_set(self::$defaultTimeZone); } @@ -44,7 +44,7 @@ class UtilsTest extends PHPUnit\Framework\TestCase /** * Resets test data before each test */ - protected function setUp() + protected function setUp(): void { if (file_exists(self::$testLogFile)) { unlink(self::$testLogFile); diff --git a/tests/api/ApiMiddlewareTest.php b/tests/api/ApiMiddlewareTest.php index df2fb33a..b157e4a7 100644 --- a/tests/api/ApiMiddlewareTest.php +++ b/tests/api/ApiMiddlewareTest.php @@ -43,7 +43,7 @@ class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase /** * Before every test, instantiate a new Api with its config, plugins and bookmarks. */ - public function setUp() + protected function setUp(): void { $this->conf = new ConfigManager('tests/utils/config/configJson'); $this->conf->set('api.secret', 'NapoleonWasALizard'); @@ -61,7 +61,7 @@ class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase /** * After every test, remove the test datastore. */ - public function tearDown() + protected function tearDown(): void { @unlink(self::$testDatastore); } diff --git a/tests/api/ApiUtilsTest.php b/tests/api/ApiUtilsTest.php index 7efec9bb..e8075a5d 100644 --- a/tests/api/ApiUtilsTest.php +++ b/tests/api/ApiUtilsTest.php @@ -13,7 +13,7 @@ class ApiUtilsTest extends \PHPUnit\Framework\TestCase /** * Force the timezone for ISO datetimes. */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { date_default_timezone_set('UTC'); } diff --git a/tests/api/controllers/history/HistoryTest.php b/tests/api/controllers/history/HistoryTest.php index f4d3b646..40f26b12 100644 --- a/tests/api/controllers/history/HistoryTest.php +++ b/tests/api/controllers/history/HistoryTest.php @@ -41,7 +41,7 @@ class HistoryTest extends \PHPUnit\Framework\TestCase /** * Before every test, instantiate a new Api with its config, plugins and bookmarks. */ - public function setUp() + protected function setUp(): void { $this->conf = new ConfigManager('tests/utils/config/configJson'); $this->refHistory = new \ReferenceHistory(); @@ -57,7 +57,7 @@ class HistoryTest extends \PHPUnit\Framework\TestCase /** * After every test, remove the test datastore. */ - public function tearDown() + protected function tearDown(): void { @unlink(self::$testHistory); } diff --git a/tests/api/controllers/info/InfoTest.php b/tests/api/controllers/info/InfoTest.php index b5c938e1..cc50d2e3 100644 --- a/tests/api/controllers/info/InfoTest.php +++ b/tests/api/controllers/info/InfoTest.php @@ -47,7 +47,7 @@ class InfoTest extends TestCase /** * Before every test, instantiate a new Api with its config, plugins and bookmarks. */ - public function setUp() + protected function setUp(): void { $this->conf = new ConfigManager('tests/utils/config/configJson'); $this->conf->set('resource.datastore', self::$testDatastore); @@ -67,7 +67,7 @@ class InfoTest extends TestCase /** * After every test, remove the test datastore. */ - public function tearDown() + protected function tearDown(): void { @unlink(self::$testDatastore); } diff --git a/tests/api/controllers/links/DeleteLinkTest.php b/tests/api/controllers/links/DeleteLinkTest.php index 6c2b3698..10dfe8bc 100644 --- a/tests/api/controllers/links/DeleteLinkTest.php +++ b/tests/api/controllers/links/DeleteLinkTest.php @@ -56,7 +56,7 @@ class DeleteLinkTest extends \PHPUnit\Framework\TestCase /** * Before each test, instantiate a new Api with its config, plugins and bookmarks. */ - public function setUp() + protected function setUp(): void { $this->conf = new ConfigManager('tests/utils/config/configJson'); $this->conf->set('resource.datastore', self::$testDatastore); @@ -78,7 +78,7 @@ class DeleteLinkTest extends \PHPUnit\Framework\TestCase /** * After each test, remove the test datastore. */ - public function tearDown() + protected function tearDown(): void { @unlink(self::$testDatastore); @unlink(self::$testHistory); diff --git a/tests/api/controllers/links/GetLinkIdTest.php b/tests/api/controllers/links/GetLinkIdTest.php index 8bb81dc8..ee42e259 100644 --- a/tests/api/controllers/links/GetLinkIdTest.php +++ b/tests/api/controllers/links/GetLinkIdTest.php @@ -55,7 +55,7 @@ class GetLinkIdTest extends \PHPUnit\Framework\TestCase /** * Before each test, instantiate a new Api with its config, plugins and bookmarks. */ - public function setUp() + protected function setUp(): void { $this->conf = new ConfigManager('tests/utils/config/configJson'); $this->conf->set('resource.datastore', self::$testDatastore); @@ -74,7 +74,7 @@ class GetLinkIdTest extends \PHPUnit\Framework\TestCase /** * After each test, remove the test datastore. */ - public function tearDown() + protected function tearDown(): void { @unlink(self::$testDatastore); } diff --git a/tests/api/controllers/links/GetLinksTest.php b/tests/api/controllers/links/GetLinksTest.php index d02e6fad..01c40c2f 100644 --- a/tests/api/controllers/links/GetLinksTest.php +++ b/tests/api/controllers/links/GetLinksTest.php @@ -55,7 +55,7 @@ class GetLinksTest extends \PHPUnit\Framework\TestCase /** * Before every test, instantiate a new Api with its config, plugins and bookmarks. */ - public function setUp() + protected function setUp(): void { $this->conf = new ConfigManager('tests/utils/config/configJson'); $this->conf->set('resource.datastore', self::$testDatastore); @@ -74,7 +74,7 @@ class GetLinksTest extends \PHPUnit\Framework\TestCase /** * After every test, remove the test datastore. */ - public function tearDown() + protected function tearDown(): void { @unlink(self::$testDatastore); } diff --git a/tests/api/controllers/links/PostLinkTest.php b/tests/api/controllers/links/PostLinkTest.php index 4e791a04..b1c9008b 100644 --- a/tests/api/controllers/links/PostLinkTest.php +++ b/tests/api/controllers/links/PostLinkTest.php @@ -70,7 +70,7 @@ class PostLinkTest extends TestCase /** * Before every test, instantiate a new Api with its config, plugins and bookmarks. */ - public function setUp() + protected function setUp(): void { $this->conf = new ConfigManager('tests/utils/config/configJson'); $this->conf->set('resource.datastore', self::$testDatastore); @@ -107,7 +107,7 @@ class PostLinkTest extends TestCase /** * After every test, remove the test datastore. */ - public function tearDown() + protected function tearDown(): void { @unlink(self::$testDatastore); @unlink(self::$testHistory); diff --git a/tests/api/controllers/links/PutLinkTest.php b/tests/api/controllers/links/PutLinkTest.php index 302cac0f..f582a2b5 100644 --- a/tests/api/controllers/links/PutLinkTest.php +++ b/tests/api/controllers/links/PutLinkTest.php @@ -62,7 +62,7 @@ class PutLinkTest extends \PHPUnit\Framework\TestCase /** * Before every test, instantiate a new Api with its config, plugins and bookmarks. */ - public function setUp() + protected function setUp(): void { $this->conf = new ConfigManager('tests/utils/config/configJson'); $this->conf->set('resource.datastore', self::$testDatastore); @@ -91,7 +91,7 @@ class PutLinkTest extends \PHPUnit\Framework\TestCase /** * After every test, remove the test datastore. */ - public function tearDown() + protected function tearDown(): void { @unlink(self::$testDatastore); @unlink(self::$testHistory); diff --git a/tests/api/controllers/tags/DeleteTagTest.php b/tests/api/controllers/tags/DeleteTagTest.php index c6748872..b0980572 100644 --- a/tests/api/controllers/tags/DeleteTagTest.php +++ b/tests/api/controllers/tags/DeleteTagTest.php @@ -57,7 +57,7 @@ class DeleteTagTest extends \PHPUnit\Framework\TestCase /** * Before each test, instantiate a new Api with its config, plugins and bookmarks. */ - public function setUp() + protected function setUp(): void { $this->conf = new ConfigManager('tests/utils/config/configJson'); $this->conf->set('resource.datastore', self::$testDatastore); @@ -79,7 +79,7 @@ class DeleteTagTest extends \PHPUnit\Framework\TestCase /** * After each test, remove the test datastore. */ - public function tearDown() + protected function tearDown(): void { @unlink(self::$testDatastore); @unlink(self::$testHistory); diff --git a/tests/api/controllers/tags/GetTagNameTest.php b/tests/api/controllers/tags/GetTagNameTest.php index b9a81f9b..f8ee10d9 100644 --- a/tests/api/controllers/tags/GetTagNameTest.php +++ b/tests/api/controllers/tags/GetTagNameTest.php @@ -53,7 +53,7 @@ class GetTagNameTest extends \PHPUnit\Framework\TestCase /** * Before each test, instantiate a new Api with its config, plugins and bookmarks. */ - public function setUp() + protected function setUp(): void { $this->conf = new ConfigManager('tests/utils/config/configJson'); $this->conf->set('resource.datastore', self::$testDatastore); @@ -72,7 +72,7 @@ class GetTagNameTest extends \PHPUnit\Framework\TestCase /** * After each test, remove the test datastore. */ - public function tearDown() + protected function tearDown(): void { @unlink(self::$testDatastore); } diff --git a/tests/api/controllers/tags/GetTagsTest.php b/tests/api/controllers/tags/GetTagsTest.php index 53a3326d..ab666f20 100644 --- a/tests/api/controllers/tags/GetTagsTest.php +++ b/tests/api/controllers/tags/GetTagsTest.php @@ -57,7 +57,7 @@ class GetTagsTest extends \PHPUnit\Framework\TestCase /** * Before every test, instantiate a new Api with its config, plugins and bookmarks. */ - public function setUp() + protected function setUp(): void { $this->conf = new ConfigManager('tests/utils/config/configJson'); $this->conf->set('resource.datastore', self::$testDatastore); @@ -78,7 +78,7 @@ class GetTagsTest extends \PHPUnit\Framework\TestCase /** * After every test, remove the test datastore. */ - public function tearDown() + protected function tearDown(): void { @unlink(self::$testDatastore); } diff --git a/tests/api/controllers/tags/PutTagTest.php b/tests/api/controllers/tags/PutTagTest.php index 2a3cc15a..e0bc8663 100644 --- a/tests/api/controllers/tags/PutTagTest.php +++ b/tests/api/controllers/tags/PutTagTest.php @@ -62,7 +62,7 @@ class PutTagTest extends \PHPUnit\Framework\TestCase /** * Before every test, instantiate a new Api with its config, plugins and bookmarks. */ - public function setUp() + protected function setUp(): void { $this->conf = new ConfigManager('tests/utils/config/configJson'); $this->conf->set('resource.datastore', self::$testDatastore); @@ -84,7 +84,7 @@ class PutTagTest extends \PHPUnit\Framework\TestCase /** * After every test, remove the test datastore. */ - public function tearDown() + protected function tearDown(): void { @unlink(self::$testDatastore); @unlink(self::$testHistory); diff --git a/tests/bookmark/BookmarkFileServiceTest.php b/tests/bookmark/BookmarkFileServiceTest.php index a4ec1013..aed4dc76 100644 --- a/tests/bookmark/BookmarkFileServiceTest.php +++ b/tests/bookmark/BookmarkFileServiceTest.php @@ -66,7 +66,7 @@ class BookmarkFileServiceTest extends TestCase * * Resets test data for each test */ - protected function setUp() + protected function setUp(): void { if (file_exists(self::$testDatastore)) { unlink(self::$testDatastore); diff --git a/tests/config/ConfigJsonTest.php b/tests/config/ConfigJsonTest.php index 33160eb0..f1612e9b 100644 --- a/tests/config/ConfigJsonTest.php +++ b/tests/config/ConfigJsonTest.php @@ -11,7 +11,7 @@ class ConfigJsonTest extends \PHPUnit\Framework\TestCase */ protected $configIO; - public function setUp() + protected function setUp(): void { $this->configIO = new ConfigJson(); } diff --git a/tests/config/ConfigManagerTest.php b/tests/config/ConfigManagerTest.php index 33830bc9..69456bce 100644 --- a/tests/config/ConfigManagerTest.php +++ b/tests/config/ConfigManagerTest.php @@ -14,7 +14,7 @@ class ConfigManagerTest extends \PHPUnit\Framework\TestCase */ protected $conf; - public function setUp() + protected function setUp(): void { $this->conf = new ConfigManager('tests/utils/config/configJson'); } diff --git a/tests/config/ConfigPhpTest.php b/tests/config/ConfigPhpTest.php index fb91b51b..a9aa80f5 100644 --- a/tests/config/ConfigPhpTest.php +++ b/tests/config/ConfigPhpTest.php @@ -15,7 +15,7 @@ class ConfigPhpTest extends \PHPUnit\Framework\TestCase */ protected $configIO; - public function setUp() + protected function setUp(): void { $this->configIO = new ConfigPhp(); } diff --git a/tests/feed/CachedPageTest.php b/tests/feed/CachedPageTest.php index 2e716432..25d640d3 100644 --- a/tests/feed/CachedPageTest.php +++ b/tests/feed/CachedPageTest.php @@ -17,7 +17,7 @@ class CachedPageTest extends \PHPUnit\Framework\TestCase /** * Create the cache directory if needed */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { if (!is_dir(self::$testCacheDir)) { mkdir(self::$testCacheDir); @@ -28,7 +28,7 @@ class CachedPageTest extends \PHPUnit\Framework\TestCase /** * Reset the page cache */ - public function setUp() + protected function setUp(): void { if (file_exists(self::$filename)) { unlink(self::$filename); diff --git a/tests/formatter/BookmarkDefaultFormatterTest.php b/tests/formatter/BookmarkDefaultFormatterTest.php index cf48b00b..9ea86c14 100644 --- a/tests/formatter/BookmarkDefaultFormatterTest.php +++ b/tests/formatter/BookmarkDefaultFormatterTest.php @@ -25,7 +25,7 @@ class BookmarkDefaultFormatterTest extends TestCase /** * Initialize formatter instance. */ - public function setUp() + protected function setUp(): void { copy('tests/utils/config/configJson.json.php', self::$testConf .'.json.php'); $this->conf = new ConfigManager(self::$testConf); diff --git a/tests/formatter/BookmarkMarkdownFormatterTest.php b/tests/formatter/BookmarkMarkdownFormatterTest.php index 3e72d1ee..a7729416 100644 --- a/tests/formatter/BookmarkMarkdownFormatterTest.php +++ b/tests/formatter/BookmarkMarkdownFormatterTest.php @@ -25,7 +25,7 @@ class BookmarkMarkdownFormatterTest extends TestCase /** * Initialize formatter instance. */ - public function setUp() + protected function setUp(): void { copy('tests/utils/config/configJson.json.php', self::$testConf .'.json.php'); $this->conf = new ConfigManager(self::$testConf); diff --git a/tests/formatter/BookmarkRawFormatterTest.php b/tests/formatter/BookmarkRawFormatterTest.php index 4491b035..76cf1172 100644 --- a/tests/formatter/BookmarkRawFormatterTest.php +++ b/tests/formatter/BookmarkRawFormatterTest.php @@ -25,7 +25,7 @@ class BookmarkRawFormatterTest extends TestCase /** * Initialize formatter instance. */ - public function setUp() + protected function setUp(): void { copy('tests/utils/config/configJson.json.php', self::$testConf .'.json.php'); $this->conf = new ConfigManager(self::$testConf); diff --git a/tests/formatter/FormatterFactoryTest.php b/tests/formatter/FormatterFactoryTest.php index 5adf3ffd..6aab6a61 100644 --- a/tests/formatter/FormatterFactoryTest.php +++ b/tests/formatter/FormatterFactoryTest.php @@ -24,7 +24,7 @@ class FormatterFactoryTest extends TestCase /** * Initialize FormatterFactory instance */ - public function setUp() + protected function setUp(): void { copy('tests/utils/config/configJson.json.php', self::$testConf .'.json.php'); $this->conf = new ConfigManager(self::$testConf); diff --git a/tests/languages/fr/LanguagesFrTest.php b/tests/languages/fr/LanguagesFrTest.php index b8b7ca3a..e412b5bc 100644 --- a/tests/languages/fr/LanguagesFrTest.php +++ b/tests/languages/fr/LanguagesFrTest.php @@ -27,7 +27,7 @@ class LanguagesFrTest extends \PHPUnit\Framework\TestCase /** * Init: force French */ - public function setUp() + protected function setUp(): void { $this->conf = new ConfigManager(self::$configFile); $this->conf->set('translation.language', 'fr'); @@ -36,7 +36,7 @@ class LanguagesFrTest extends \PHPUnit\Framework\TestCase /** * Reset the locale since gettext seems to mess with it, making it too long */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { if (! empty(getenv('UT_LOCALE'))) { setlocale(LC_ALL, getenv('UT_LOCALE')); diff --git a/tests/legacy/LegacyLinkDBTest.php b/tests/legacy/LegacyLinkDBTest.php index 0884ad03..92cf607c 100644 --- a/tests/legacy/LegacyLinkDBTest.php +++ b/tests/legacy/LegacyLinkDBTest.php @@ -52,7 +52,7 @@ class LegacyLinkDBTest extends \PHPUnit\Framework\TestCase * * Resets test data for each test */ - protected function setUp() + protected function setUp(): void { if (file_exists(self::$testDatastore)) { unlink(self::$testDatastore); diff --git a/tests/legacy/LegacyLinkFilterTest.php b/tests/legacy/LegacyLinkFilterTest.php index ba9ec529..8223cc15 100644 --- a/tests/legacy/LegacyLinkFilterTest.php +++ b/tests/legacy/LegacyLinkFilterTest.php @@ -34,7 +34,7 @@ class LegacyLinkFilterTest extends \PHPUnit\Framework\TestCase /** * Instantiate linkFilter with ReferenceLinkDB data. */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { self::$refDB = new ReferenceLinkDB(true); self::$refDB->write(self::$testDatastore); diff --git a/tests/legacy/LegacyUpdaterTest.php b/tests/legacy/LegacyUpdaterTest.php index 7c429811..9b693dcb 100644 --- a/tests/legacy/LegacyUpdaterTest.php +++ b/tests/legacy/LegacyUpdaterTest.php @@ -40,7 +40,7 @@ class LegacyUpdaterTest extends \PHPUnit\Framework\TestCase /** * Executed before each test. */ - public function setUp() + protected function setUp(): void { copy('tests/utils/config/configJson.json.php', self::$configFile .'.json.php'); $this->conf = new ConfigManager(self::$configFile); @@ -754,7 +754,7 @@ $GLOBALS[\'privateLinkByDefault\'] = true;'; if (isset($_SESSION['warnings'])) { unset($_SESSION['warnings']); } - + $updater = new LegacyUpdater([], [], $this->conf, true, $_SESSION); $this->assertTrue($updater->updateMethodWebThumbnailer()); $this->assertFalse($this->conf->exists('thumbnail')); diff --git a/tests/netscape/BookmarkExportTest.php b/tests/netscape/BookmarkExportTest.php index 509da51d..13b85f3d 100644 --- a/tests/netscape/BookmarkExportTest.php +++ b/tests/netscape/BookmarkExportTest.php @@ -54,7 +54,7 @@ class BookmarkExportTest extends TestCase /** * Instantiate reference data */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { static::$conf = new ConfigManager('tests/utils/config/configJson'); static::$conf->set('resource.datastore', static::$testDatastore); diff --git a/tests/netscape/BookmarkImportTest.php b/tests/netscape/BookmarkImportTest.php index f678e26b..89ae4aa7 100644 --- a/tests/netscape/BookmarkImportTest.php +++ b/tests/netscape/BookmarkImportTest.php @@ -75,7 +75,7 @@ class BookmarkImportTest extends TestCase */ protected static $defaultTimeZone; - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { self::$defaultTimeZone = date_default_timezone_get(); // Timezone without DST for test consistency @@ -85,7 +85,7 @@ class BookmarkImportTest extends TestCase /** * Resets test data before each test */ - protected function setUp() + protected function setUp(): void { if (file_exists(self::$testDatastore)) { unlink(self::$testDatastore); @@ -104,12 +104,12 @@ class BookmarkImportTest extends TestCase /** * Delete history file. */ - public function tearDown() + protected function tearDown(): void { @unlink(self::$historyFilePath); } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { date_default_timezone_set(self::$defaultTimeZone); } diff --git a/tests/plugins/PluginAddlinkTest.php b/tests/plugins/PluginAddlinkTest.php index aa5c6988..1f60d289 100644 --- a/tests/plugins/PluginAddlinkTest.php +++ b/tests/plugins/PluginAddlinkTest.php @@ -14,7 +14,7 @@ class PluginAddlinkTest extends \PHPUnit\Framework\TestCase /** * Reset plugin path. */ - public function setUp() + protected function setUp(): void { PluginManager::$PLUGINS_PATH = 'plugins'; } diff --git a/tests/plugins/PluginDefaultColorsTest.php b/tests/plugins/PluginDefaultColorsTest.php index 9835dfa3..240bb4b2 100644 --- a/tests/plugins/PluginDefaultColorsTest.php +++ b/tests/plugins/PluginDefaultColorsTest.php @@ -19,7 +19,7 @@ class PluginDefaultColorsTest extends TestCase /** * Reset plugin path */ - public function setUp() + protected function setUp(): void { PluginManager::$PLUGINS_PATH = 'sandbox'; mkdir(PluginManager::$PLUGINS_PATH . '/default_colors/'); @@ -32,7 +32,7 @@ class PluginDefaultColorsTest extends TestCase /** * Remove sandbox files and folder */ - public function tearDown() + protected function tearDown(): void { if (file_exists('sandbox/default_colors/default_colors.css.template')) { unlink('sandbox/default_colors/default_colors.css.template'); diff --git a/tests/plugins/PluginPlayvideosTest.php b/tests/plugins/PluginPlayvideosTest.php index b7b6ce53..de1a1aec 100644 --- a/tests/plugins/PluginPlayvideosTest.php +++ b/tests/plugins/PluginPlayvideosTest.php @@ -19,7 +19,7 @@ class PluginPlayvideosTest extends \PHPUnit\Framework\TestCase /** * Reset plugin path */ - public function setUp() + protected function setUp(): void { PluginManager::$PLUGINS_PATH = 'plugins'; } diff --git a/tests/plugins/PluginPubsubhubbubTest.php b/tests/plugins/PluginPubsubhubbubTest.php index e66f484e..d30c3703 100644 --- a/tests/plugins/PluginPubsubhubbubTest.php +++ b/tests/plugins/PluginPubsubhubbubTest.php @@ -21,7 +21,7 @@ class PluginPubsubhubbubTest extends \PHPUnit\Framework\TestCase /** * Reset plugin path */ - public function setUp() + protected function setUp(): void { PluginManager::$PLUGINS_PATH = 'plugins'; } diff --git a/tests/plugins/PluginQrcodeTest.php b/tests/plugins/PluginQrcodeTest.php index c9f8c733..bc6be0eb 100644 --- a/tests/plugins/PluginQrcodeTest.php +++ b/tests/plugins/PluginQrcodeTest.php @@ -19,7 +19,7 @@ class PluginQrcodeTest extends \PHPUnit\Framework\TestCase /** * Reset plugin path */ - public function setUp() + protected function setUp(): void { PluginManager::$PLUGINS_PATH = 'plugins'; } diff --git a/tests/plugins/PluginWallabagTest.php b/tests/plugins/PluginWallabagTest.php index 79751921..372929ea 100644 --- a/tests/plugins/PluginWallabagTest.php +++ b/tests/plugins/PluginWallabagTest.php @@ -15,7 +15,7 @@ class PluginWallabagTest extends \PHPUnit\Framework\TestCase /** * Reset plugin path */ - public function setUp() + protected function setUp(): void { PluginManager::$PLUGINS_PATH = 'plugins'; } diff --git a/tests/plugins/WallabagInstanceTest.php b/tests/plugins/WallabagInstanceTest.php index a3cd9076..4cb0d4cc 100644 --- a/tests/plugins/WallabagInstanceTest.php +++ b/tests/plugins/WallabagInstanceTest.php @@ -14,7 +14,7 @@ class WallabagInstanceTest extends \PHPUnit\Framework\TestCase /** * Reset plugin path */ - public function setUp() + protected function setUp(): void { $this->instance = 'http://some.url'; } diff --git a/tests/render/PageCacheManagerTest.php b/tests/render/PageCacheManagerTest.php index c258f45f..4aa7e179 100644 --- a/tests/render/PageCacheManagerTest.php +++ b/tests/render/PageCacheManagerTest.php @@ -29,7 +29,7 @@ class PageCacheManagerTest extends TestCase /** * Populate the cache with dummy files */ - public function setUp() + protected function setUp(): void { $this->cacheManager = new PageCacheManager(static::$testCacheDir, true); @@ -48,7 +48,7 @@ class PageCacheManagerTest extends TestCase /** * Remove dummycache folder after each tests. */ - public function tearDown() + protected function tearDown(): void { array_map('unlink', glob(self::$testCacheDir . '/*')); rmdir(self::$testCacheDir); diff --git a/tests/security/BanManagerTest.php b/tests/security/BanManagerTest.php index bba7c8ad..2fef82f5 100644 --- a/tests/security/BanManagerTest.php +++ b/tests/security/BanManagerTest.php @@ -32,7 +32,7 @@ class BanManagerTest extends TestCase /** * Prepare or reset test resources */ - public function setUp() + protected function setUp(): void { if (file_exists($this->banFile)) { unlink($this->banFile); diff --git a/tests/security/LoginManagerTest.php b/tests/security/LoginManagerTest.php index f242be09..cc9aa647 100644 --- a/tests/security/LoginManagerTest.php +++ b/tests/security/LoginManagerTest.php @@ -63,7 +63,7 @@ class LoginManagerTest extends TestCase /** * Prepare or reset test resources */ - public function setUp() + protected function setUp(): void { if (file_exists($this->banFile)) { unlink($this->banFile); diff --git a/tests/security/SessionManagerTest.php b/tests/security/SessionManagerTest.php index 11a59f9c..27e3b1a9 100644 --- a/tests/security/SessionManagerTest.php +++ b/tests/security/SessionManagerTest.php @@ -24,7 +24,7 @@ class SessionManagerTest extends TestCase /** * Assign reference data */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { self::$sidHashes = \ReferenceSessionIdHashes::getHashes(); } @@ -32,7 +32,7 @@ class SessionManagerTest extends TestCase /** * Initialize or reset test resources */ - public function setUp() + protected function setUp(): void { $this->conf = new \FakeConfigManager([ 'credentials.login' => 'johndoe', diff --git a/tests/updater/UpdaterTest.php b/tests/updater/UpdaterTest.php index a7dd70bf..277f2fb0 100644 --- a/tests/updater/UpdaterTest.php +++ b/tests/updater/UpdaterTest.php @@ -42,7 +42,7 @@ class UpdaterTest extends TestCase /** * Executed before each test. */ - public function setUp() + protected function setUp(): void { $this->refDB = new \ReferenceLinkDB(); $this->refDB->write(self::$testDatastore); -- 2.41.0