From e26e2060f5470ce8bf4c5973284bae07b8af170a Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Fri, 17 Jan 2020 21:34:12 +0100 Subject: Add and update unit test for the new system (Bookmark + Service) See #1307 --- tests/bootstrap.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/bootstrap.php') diff --git a/tests/bootstrap.php b/tests/bootstrap.php index d36d73cd..0afbcba6 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -4,3 +4,21 @@ require_once 'vendor/autoload.php'; $conf = new \Shaarli\Config\ConfigManager('tests/utils/config/configJson'); new \Shaarli\Languages('en', $conf); + +// is_iterable is only compatible with PHP 7.1+ +if (!function_exists('is_iterable')) { + function is_iterable($var) + { + return is_array($var) || $var instanceof \Traversable; + } +} + +// TODO: remove this after fixing UT +require_once 'application/bookmark/LinkUtils.php'; +require_once 'application/Utils.php'; +require_once 'application/http/UrlUtils.php'; +require_once 'application/http/HttpUtils.php'; +require_once 'application/feed/Cache.php'; +require_once 'tests/utils/ReferenceLinkDB.php'; +require_once 'tests/utils/ReferenceHistory.php'; +require_once 'tests/utils/FakeBookmarkService.php'; -- cgit v1.2.3 From b0428aa9b02b058b72c40b6e8dc2298d55bf692f Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Thu, 23 Jan 2020 21:13:41 +0100 Subject: Migrate cache purge function to a proper class And update dependencies and tests. Note that SESSION['tags'] has been removed a log ago --- tests/bootstrap.php | 1 - 1 file changed, 1 deletion(-) (limited to 'tests/bootstrap.php') diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 0afbcba6..c80bcb33 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -18,7 +18,6 @@ require_once 'application/bookmark/LinkUtils.php'; require_once 'application/Utils.php'; require_once 'application/http/UrlUtils.php'; require_once 'application/http/HttpUtils.php'; -require_once 'application/feed/Cache.php'; require_once 'tests/utils/ReferenceLinkDB.php'; require_once 'tests/utils/ReferenceHistory.php'; require_once 'tests/utils/FakeBookmarkService.php'; -- cgit v1.2.3 From dd09ec52b20b4a548ecf5c847627575e506e3a50 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Wed, 20 May 2020 12:43:40 +0200 Subject: Refactor front controller tests to create container mock using a trait --- tests/bootstrap.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/bootstrap.php') diff --git a/tests/bootstrap.php b/tests/bootstrap.php index c80bcb33..6bb345c2 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -21,3 +21,5 @@ require_once 'application/http/HttpUtils.php'; require_once 'tests/utils/ReferenceLinkDB.php'; require_once 'tests/utils/ReferenceHistory.php'; require_once 'tests/utils/FakeBookmarkService.php'; +require_once 'tests/container/ShaarliTestContainer.php'; +require_once 'tests/front/controller/FrontControllerMockHelper.php'; -- cgit v1.2.3 From 2899ebb5b5e82890c877151f5c02045266ac9973 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Fri, 22 May 2020 13:20:31 +0200 Subject: Initialize admin Slim controllers - Reorganize visitor controllers - Fix redirection with Slim's requests base path - Fix daily links --- tests/bootstrap.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/bootstrap.php') diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 6bb345c2..511698ff 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -22,4 +22,5 @@ require_once 'tests/utils/ReferenceLinkDB.php'; require_once 'tests/utils/ReferenceHistory.php'; require_once 'tests/utils/FakeBookmarkService.php'; require_once 'tests/container/ShaarliTestContainer.php'; -require_once 'tests/front/controller/FrontControllerMockHelper.php'; +require_once 'tests/front/controller/visitor/FrontControllerMockHelper.php'; +require_once 'tests/front/controller/admin/FrontAdminControllerMockHelper.php'; -- cgit v1.2.3 From c4ad3d4f061d05a01db25aa54dda830ba776792d Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 7 Jul 2020 10:15:56 +0200 Subject: Process Shaarli install through Slim controller --- tests/bootstrap.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests/bootstrap.php') diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 511698ff..d4ddedd5 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -18,9 +18,14 @@ require_once 'application/bookmark/LinkUtils.php'; require_once 'application/Utils.php'; require_once 'application/http/UrlUtils.php'; require_once 'application/http/HttpUtils.php'; -require_once 'tests/utils/ReferenceLinkDB.php'; -require_once 'tests/utils/ReferenceHistory.php'; -require_once 'tests/utils/FakeBookmarkService.php'; require_once 'tests/container/ShaarliTestContainer.php'; require_once 'tests/front/controller/visitor/FrontControllerMockHelper.php'; require_once 'tests/front/controller/admin/FrontAdminControllerMockHelper.php'; +require_once 'tests/updater/DummyUpdater.php'; +require_once 'tests/utils/FakeBookmarkService.php'; +require_once 'tests/utils/FakeConfigManager.php'; +require_once 'tests/utils/ReferenceHistory.php'; +require_once 'tests/utils/ReferenceLinkDB.php'; +require_once 'tests/utils/ReferenceSessionIdHashes.php'; + +\ReferenceSessionIdHashes::genAllHashes(); -- cgit v1.2.3 From a5a9cf23acd1248585173aa32757d9720b5f2d62 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 29 Sep 2020 14:41:40 +0200 Subject: Compatibility with PHPUnit 9 --- tests/bootstrap.php | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/bootstrap.php') diff --git a/tests/bootstrap.php b/tests/bootstrap.php index d4ddedd5..2d675c9a 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -18,6 +18,7 @@ require_once 'application/bookmark/LinkUtils.php'; require_once 'application/Utils.php'; require_once 'application/http/UrlUtils.php'; require_once 'application/http/HttpUtils.php'; +require_once 'tests/TestCase.php'; require_once 'tests/container/ShaarliTestContainer.php'; require_once 'tests/front/controller/visitor/FrontControllerMockHelper.php'; require_once 'tests/front/controller/admin/FrontAdminControllerMockHelper.php'; -- cgit v1.2.3