aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/front/controller
diff options
context:
space:
mode:
Diffstat (limited to 'tests/front/controller')
-rw-r--r--tests/front/controller/admin/ConfigureControllerTest.php2
-rw-r--r--tests/front/controller/admin/ExportControllerTest.php2
-rw-r--r--tests/front/controller/admin/ImportControllerTest.php2
-rw-r--r--tests/front/controller/admin/LogoutControllerTest.php3
-rw-r--r--tests/front/controller/admin/ManageShaareControllerTest/AddShaareTest.php2
-rw-r--r--tests/front/controller/admin/ManageShaareControllerTest/ChangeVisibilityBookmarkTest.php2
-rw-r--r--tests/front/controller/admin/ManageShaareControllerTest/DeleteBookmarkTest.php2
-rw-r--r--tests/front/controller/admin/ManageShaareControllerTest/DisplayCreateFormTest.php12
-rw-r--r--tests/front/controller/admin/ManageShaareControllerTest/DisplayEditFormTest.php2
-rw-r--r--tests/front/controller/admin/ManageShaareControllerTest/PinBookmarkTest.php2
-rw-r--r--tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php40
-rw-r--r--tests/front/controller/admin/ManageTagControllerTest.php2
-rw-r--r--tests/front/controller/admin/PasswordControllerTest.php2
-rw-r--r--tests/front/controller/admin/PluginsControllerTest.php2
-rw-r--r--tests/front/controller/admin/SessionFilterControllerTest.php2
-rw-r--r--tests/front/controller/admin/ShaarliAdminControllerTest.php2
-rw-r--r--tests/front/controller/admin/ThumbnailsControllerTest.php2
-rw-r--r--tests/front/controller/admin/TokenControllerTest.php2
-rw-r--r--tests/front/controller/admin/ToolsControllerTest.php2
-rw-r--r--tests/front/controller/visitor/BookmarkListControllerTest.php2
-rw-r--r--tests/front/controller/visitor/DailyControllerTest.php48
-rw-r--r--tests/front/controller/visitor/ErrorControllerTest.php2
-rw-r--r--tests/front/controller/visitor/ErrorNotFoundControllerTest.php2
-rw-r--r--tests/front/controller/visitor/FeedControllerTest.php38
-rw-r--r--tests/front/controller/visitor/FrontControllerMockHelper.php3
-rw-r--r--tests/front/controller/visitor/InstallControllerTest.php2
-rw-r--r--tests/front/controller/visitor/LoginControllerTest.php2
-rw-r--r--tests/front/controller/visitor/OpenSearchControllerTest.php2
-rw-r--r--tests/front/controller/visitor/PictureWallControllerTest.php18
-rw-r--r--tests/front/controller/visitor/PublicSessionFilterControllerTest.php2
-rw-r--r--tests/front/controller/visitor/ShaarliVisitorControllerTest.php2
-rw-r--r--tests/front/controller/visitor/TagCloudControllerTest.php74
-rw-r--r--tests/front/controller/visitor/TagControllerTest.php2
33 files changed, 155 insertions, 131 deletions
diff --git a/tests/front/controller/admin/ConfigureControllerTest.php b/tests/front/controller/admin/ConfigureControllerTest.php
index 612f20f1..aca6cff3 100644
--- a/tests/front/controller/admin/ConfigureControllerTest.php
+++ b/tests/front/controller/admin/ConfigureControllerTest.php
@@ -4,10 +4,10 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin; 5namespace Shaarli\Front\Controller\Admin;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Config\ConfigManager; 7use Shaarli\Config\ConfigManager;
9use Shaarli\Front\Exception\WrongTokenException; 8use Shaarli\Front\Exception\WrongTokenException;
10use Shaarli\Security\SessionManager; 9use Shaarli\Security\SessionManager;
10use Shaarli\TestCase;
11use Shaarli\Thumbnailer; 11use Shaarli\Thumbnailer;
12use Slim\Http\Request; 12use Slim\Http\Request;
13use Slim\Http\Response; 13use Slim\Http\Response;
diff --git a/tests/front/controller/admin/ExportControllerTest.php b/tests/front/controller/admin/ExportControllerTest.php
index 12d26f4a..0e6f2762 100644
--- a/tests/front/controller/admin/ExportControllerTest.php
+++ b/tests/front/controller/admin/ExportControllerTest.php
@@ -4,12 +4,12 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin; 5namespace Shaarli\Front\Controller\Admin;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Bookmark\Bookmark; 7use Shaarli\Bookmark\Bookmark;
9use Shaarli\Formatter\BookmarkFormatter; 8use Shaarli\Formatter\BookmarkFormatter;
10use Shaarli\Formatter\BookmarkRawFormatter; 9use Shaarli\Formatter\BookmarkRawFormatter;
11use Shaarli\Netscape\NetscapeBookmarkUtils; 10use Shaarli\Netscape\NetscapeBookmarkUtils;
12use Shaarli\Security\SessionManager; 11use Shaarli\Security\SessionManager;
12use Shaarli\TestCase;
13use Slim\Http\Request; 13use Slim\Http\Request;
14use Slim\Http\Response; 14use Slim\Http\Response;
15 15
diff --git a/tests/front/controller/admin/ImportControllerTest.php b/tests/front/controller/admin/ImportControllerTest.php
index eb31fad0..c266caa5 100644
--- a/tests/front/controller/admin/ImportControllerTest.php
+++ b/tests/front/controller/admin/ImportControllerTest.php
@@ -4,10 +4,10 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin; 5namespace Shaarli\Front\Controller\Admin;
6 6
7use PHPUnit\Framework\TestCase;
8use Psr\Http\Message\UploadedFileInterface; 7use Psr\Http\Message\UploadedFileInterface;
9use Shaarli\Netscape\NetscapeBookmarkUtils; 8use Shaarli\Netscape\NetscapeBookmarkUtils;
10use Shaarli\Security\SessionManager; 9use Shaarli\Security\SessionManager;
10use Shaarli\TestCase;
11use Slim\Http\Request; 11use Slim\Http\Request;
12use Slim\Http\Response; 12use Slim\Http\Response;
13use Slim\Http\UploadedFile; 13use Slim\Http\UploadedFile;
diff --git a/tests/front/controller/admin/LogoutControllerTest.php b/tests/front/controller/admin/LogoutControllerTest.php
index 45e84dc0..94e53019 100644
--- a/tests/front/controller/admin/LogoutControllerTest.php
+++ b/tests/front/controller/admin/LogoutControllerTest.php
@@ -4,10 +4,9 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin; 5namespace Shaarli\Front\Controller\Admin;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Security\CookieManager; 7use Shaarli\Security\CookieManager;
9use Shaarli\Security\LoginManager;
10use Shaarli\Security\SessionManager; 8use Shaarli\Security\SessionManager;
9use Shaarli\TestCase;
11use Slim\Http\Request; 10use Slim\Http\Request;
12use Slim\Http\Response; 11use Slim\Http\Response;
13 12
diff --git a/tests/front/controller/admin/ManageShaareControllerTest/AddShaareTest.php b/tests/front/controller/admin/ManageShaareControllerTest/AddShaareTest.php
index 7d5b752a..0f27ec2f 100644
--- a/tests/front/controller/admin/ManageShaareControllerTest/AddShaareTest.php
+++ b/tests/front/controller/admin/ManageShaareControllerTest/AddShaareTest.php
@@ -4,10 +4,10 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin\ManageShaareControllerTest; 5namespace Shaarli\Front\Controller\Admin\ManageShaareControllerTest;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Front\Controller\Admin\FrontAdminControllerMockHelper; 7use Shaarli\Front\Controller\Admin\FrontAdminControllerMockHelper;
9use Shaarli\Front\Controller\Admin\ManageShaareController; 8use Shaarli\Front\Controller\Admin\ManageShaareController;
10use Shaarli\Http\HttpAccess; 9use Shaarli\Http\HttpAccess;
10use Shaarli\TestCase;
11use Slim\Http\Request; 11use Slim\Http\Request;
12use Slim\Http\Response; 12use Slim\Http\Response;
13 13
diff --git a/tests/front/controller/admin/ManageShaareControllerTest/ChangeVisibilityBookmarkTest.php b/tests/front/controller/admin/ManageShaareControllerTest/ChangeVisibilityBookmarkTest.php
index 5a615791..096d0774 100644
--- a/tests/front/controller/admin/ManageShaareControllerTest/ChangeVisibilityBookmarkTest.php
+++ b/tests/front/controller/admin/ManageShaareControllerTest/ChangeVisibilityBookmarkTest.php
@@ -4,7 +4,6 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin\ManageShaareControllerTest; 5namespace Shaarli\Front\Controller\Admin\ManageShaareControllerTest;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Bookmark\Bookmark; 7use Shaarli\Bookmark\Bookmark;
9use Shaarli\Bookmark\Exception\BookmarkNotFoundException; 8use Shaarli\Bookmark\Exception\BookmarkNotFoundException;
10use Shaarli\Formatter\BookmarkFormatter; 9use Shaarli\Formatter\BookmarkFormatter;
@@ -14,6 +13,7 @@ use Shaarli\Front\Controller\Admin\FrontAdminControllerMockHelper;
14use Shaarli\Front\Controller\Admin\ManageShaareController; 13use Shaarli\Front\Controller\Admin\ManageShaareController;
15use Shaarli\Http\HttpAccess; 14use Shaarli\Http\HttpAccess;
16use Shaarli\Security\SessionManager; 15use Shaarli\Security\SessionManager;
16use Shaarli\TestCase;
17use Slim\Http\Request; 17use Slim\Http\Request;
18use Slim\Http\Response; 18use Slim\Http\Response;
19 19
diff --git a/tests/front/controller/admin/ManageShaareControllerTest/DeleteBookmarkTest.php b/tests/front/controller/admin/ManageShaareControllerTest/DeleteBookmarkTest.php
index dee622bb..ba774e21 100644
--- a/tests/front/controller/admin/ManageShaareControllerTest/DeleteBookmarkTest.php
+++ b/tests/front/controller/admin/ManageShaareControllerTest/DeleteBookmarkTest.php
@@ -4,7 +4,6 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin\ManageShaareControllerTest; 5namespace Shaarli\Front\Controller\Admin\ManageShaareControllerTest;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Bookmark\Bookmark; 7use Shaarli\Bookmark\Bookmark;
9use Shaarli\Bookmark\Exception\BookmarkNotFoundException; 8use Shaarli\Bookmark\Exception\BookmarkNotFoundException;
10use Shaarli\Formatter\BookmarkFormatter; 9use Shaarli\Formatter\BookmarkFormatter;
@@ -13,6 +12,7 @@ use Shaarli\Front\Controller\Admin\FrontAdminControllerMockHelper;
13use Shaarli\Front\Controller\Admin\ManageShaareController; 12use Shaarli\Front\Controller\Admin\ManageShaareController;
14use Shaarli\Http\HttpAccess; 13use Shaarli\Http\HttpAccess;
15use Shaarli\Security\SessionManager; 14use Shaarli\Security\SessionManager;
15use Shaarli\TestCase;
16use Slim\Http\Request; 16use Slim\Http\Request;
17use Slim\Http\Response; 17use Slim\Http\Response;
18 18
diff --git a/tests/front/controller/admin/ManageShaareControllerTest/DisplayCreateFormTest.php b/tests/front/controller/admin/ManageShaareControllerTest/DisplayCreateFormTest.php
index 777583d5..2eb95251 100644
--- a/tests/front/controller/admin/ManageShaareControllerTest/DisplayCreateFormTest.php
+++ b/tests/front/controller/admin/ManageShaareControllerTest/DisplayCreateFormTest.php
@@ -4,12 +4,12 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin\ManageShaareControllerTest; 5namespace Shaarli\Front\Controller\Admin\ManageShaareControllerTest;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Bookmark\Bookmark; 7use Shaarli\Bookmark\Bookmark;
9use Shaarli\Config\ConfigManager; 8use Shaarli\Config\ConfigManager;
10use Shaarli\Front\Controller\Admin\FrontAdminControllerMockHelper; 9use Shaarli\Front\Controller\Admin\FrontAdminControllerMockHelper;
11use Shaarli\Front\Controller\Admin\ManageShaareController; 10use Shaarli\Front\Controller\Admin\ManageShaareController;
12use Shaarli\Http\HttpAccess; 11use Shaarli\Http\HttpAccess;
12use Shaarli\TestCase;
13use Slim\Http\Request; 13use Slim\Http\Request;
14use Slim\Http\Response; 14use Slim\Http\Response;
15 15
@@ -96,12 +96,14 @@ class DisplayCreateFormTest extends TestCase
96 96
97 // Make sure that PluginManager hook is triggered 97 // Make sure that PluginManager hook is triggered
98 $this->container->pluginManager 98 $this->container->pluginManager
99 ->expects(static::at(0)) 99 ->expects(static::atLeastOnce())
100 ->method('executeHooks') 100 ->method('executeHooks')
101 ->withConsecutive(['render_editlink'], ['render_includes'])
101 ->willReturnCallback(function (string $hook, array $data) use ($remoteTitle, $remoteDesc): array { 102 ->willReturnCallback(function (string $hook, array $data) use ($remoteTitle, $remoteDesc): array {
102 static::assertSame('render_editlink', $hook); 103 if ('render_editlink' === $hook) {
103 static::assertSame($remoteTitle, $data['link']['title']); 104 static::assertSame($remoteTitle, $data['link']['title']);
104 static::assertSame($remoteDesc, $data['link']['description']); 105 static::assertSame($remoteDesc, $data['link']['description']);
106 }
105 107
106 return $data; 108 return $data;
107 }) 109 })
diff --git a/tests/front/controller/admin/ManageShaareControllerTest/DisplayEditFormTest.php b/tests/front/controller/admin/ManageShaareControllerTest/DisplayEditFormTest.php
index 1a1cdcf3..2dc3f41c 100644
--- a/tests/front/controller/admin/ManageShaareControllerTest/DisplayEditFormTest.php
+++ b/tests/front/controller/admin/ManageShaareControllerTest/DisplayEditFormTest.php
@@ -4,13 +4,13 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin\ManageShaareControllerTest; 5namespace Shaarli\Front\Controller\Admin\ManageShaareControllerTest;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Bookmark\Bookmark; 7use Shaarli\Bookmark\Bookmark;
9use Shaarli\Bookmark\Exception\BookmarkNotFoundException; 8use Shaarli\Bookmark\Exception\BookmarkNotFoundException;
10use Shaarli\Front\Controller\Admin\FrontAdminControllerMockHelper; 9use Shaarli\Front\Controller\Admin\FrontAdminControllerMockHelper;
11use Shaarli\Front\Controller\Admin\ManageShaareController; 10use Shaarli\Front\Controller\Admin\ManageShaareController;
12use Shaarli\Http\HttpAccess; 11use Shaarli\Http\HttpAccess;
13use Shaarli\Security\SessionManager; 12use Shaarli\Security\SessionManager;
13use Shaarli\TestCase;
14use Slim\Http\Request; 14use Slim\Http\Request;
15use Slim\Http\Response; 15use Slim\Http\Response;
16 16
diff --git a/tests/front/controller/admin/ManageShaareControllerTest/PinBookmarkTest.php b/tests/front/controller/admin/ManageShaareControllerTest/PinBookmarkTest.php
index 1607b475..50ce7df1 100644
--- a/tests/front/controller/admin/ManageShaareControllerTest/PinBookmarkTest.php
+++ b/tests/front/controller/admin/ManageShaareControllerTest/PinBookmarkTest.php
@@ -4,13 +4,13 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin\ManageShaareControllerTest; 5namespace Shaarli\Front\Controller\Admin\ManageShaareControllerTest;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Bookmark\Bookmark; 7use Shaarli\Bookmark\Bookmark;
9use Shaarli\Bookmark\Exception\BookmarkNotFoundException; 8use Shaarli\Bookmark\Exception\BookmarkNotFoundException;
10use Shaarli\Front\Controller\Admin\FrontAdminControllerMockHelper; 9use Shaarli\Front\Controller\Admin\FrontAdminControllerMockHelper;
11use Shaarli\Front\Controller\Admin\ManageShaareController; 10use Shaarli\Front\Controller\Admin\ManageShaareController;
12use Shaarli\Http\HttpAccess; 11use Shaarli\Http\HttpAccess;
13use Shaarli\Security\SessionManager; 12use Shaarli\Security\SessionManager;
13use Shaarli\TestCase;
14use Slim\Http\Request; 14use Slim\Http\Request;
15use Slim\Http\Response; 15use Slim\Http\Response;
16 16
diff --git a/tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php b/tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php
index 58eaaa9b..3999b44e 100644
--- a/tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php
+++ b/tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php
@@ -4,7 +4,6 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin\ManageShaareControllerTest; 5namespace Shaarli\Front\Controller\Admin\ManageShaareControllerTest;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Bookmark\Bookmark; 7use Shaarli\Bookmark\Bookmark;
9use Shaarli\Config\ConfigManager; 8use Shaarli\Config\ConfigManager;
10use Shaarli\Front\Controller\Admin\FrontAdminControllerMockHelper; 9use Shaarli\Front\Controller\Admin\FrontAdminControllerMockHelper;
@@ -12,6 +11,7 @@ use Shaarli\Front\Controller\Admin\ManageShaareController;
12use Shaarli\Front\Exception\WrongTokenException; 11use Shaarli\Front\Exception\WrongTokenException;
13use Shaarli\Http\HttpAccess; 12use Shaarli\Http\HttpAccess;
14use Shaarli\Security\SessionManager; 13use Shaarli\Security\SessionManager;
14use Shaarli\TestCase;
15use Shaarli\Thumbnailer; 15use Shaarli\Thumbnailer;
16use Slim\Http\Request; 16use Slim\Http\Request;
17use Slim\Http\Response; 17use Slim\Http\Response;
@@ -88,17 +88,18 @@ class SaveBookmarkTest extends TestCase
88 88
89 // Make sure that PluginManager hook is triggered 89 // Make sure that PluginManager hook is triggered
90 $this->container->pluginManager 90 $this->container->pluginManager
91 ->expects(static::at(0)) 91 ->expects(static::atLeastOnce())
92 ->method('executeHooks') 92 ->method('executeHooks')
93 ->withConsecutive(['save_link'])
93 ->willReturnCallback(function (string $hook, array $data) use ($parameters, $id): array { 94 ->willReturnCallback(function (string $hook, array $data) use ($parameters, $id): array {
94 static::assertSame('save_link', $hook); 95 if ('save_link' === $hook) {
95 96 static::assertSame($id, $data['id']);
96 static::assertSame($id, $data['id']); 97 static::assertSame($parameters['lf_url'], $data['url']);
97 static::assertSame($parameters['lf_url'], $data['url']); 98 static::assertSame($parameters['lf_title'], $data['title']);
98 static::assertSame($parameters['lf_title'], $data['title']); 99 static::assertSame($parameters['lf_description'], $data['description']);
99 static::assertSame($parameters['lf_description'], $data['description']); 100 static::assertSame($parameters['lf_tags'], $data['tags']);
100 static::assertSame($parameters['lf_tags'], $data['tags']); 101 static::assertTrue($data['private']);
101 static::assertTrue($data['private']); 102 }
102 103
103 return $data; 104 return $data;
104 }) 105 })
@@ -174,17 +175,18 @@ class SaveBookmarkTest extends TestCase
174 175
175 // Make sure that PluginManager hook is triggered 176 // Make sure that PluginManager hook is triggered
176 $this->container->pluginManager 177 $this->container->pluginManager
177 ->expects(static::at(0)) 178 ->expects(static::atLeastOnce())
178 ->method('executeHooks') 179 ->method('executeHooks')
180 ->withConsecutive(['save_link'])
179 ->willReturnCallback(function (string $hook, array $data) use ($parameters, $id): array { 181 ->willReturnCallback(function (string $hook, array $data) use ($parameters, $id): array {
180 static::assertSame('save_link', $hook); 182 if ('save_link' === $hook) {
181 183 static::assertSame($id, $data['id']);
182 static::assertSame($id, $data['id']); 184 static::assertSame($parameters['lf_url'], $data['url']);
183 static::assertSame($parameters['lf_url'], $data['url']); 185 static::assertSame($parameters['lf_title'], $data['title']);
184 static::assertSame($parameters['lf_title'], $data['title']); 186 static::assertSame($parameters['lf_description'], $data['description']);
185 static::assertSame($parameters['lf_description'], $data['description']); 187 static::assertSame($parameters['lf_tags'], $data['tags']);
186 static::assertSame($parameters['lf_tags'], $data['tags']); 188 static::assertTrue($data['private']);
187 static::assertTrue($data['private']); 189 }
188 190
189 return $data; 191 return $data;
190 }) 192 })
diff --git a/tests/front/controller/admin/ManageTagControllerTest.php b/tests/front/controller/admin/ManageTagControllerTest.php
index 09ba0b4b..8a0ff7a9 100644
--- a/tests/front/controller/admin/ManageTagControllerTest.php
+++ b/tests/front/controller/admin/ManageTagControllerTest.php
@@ -4,11 +4,11 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin; 5namespace Shaarli\Front\Controller\Admin;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Bookmark\Bookmark; 7use Shaarli\Bookmark\Bookmark;
9use Shaarli\Bookmark\BookmarkFilter; 8use Shaarli\Bookmark\BookmarkFilter;
10use Shaarli\Front\Exception\WrongTokenException; 9use Shaarli\Front\Exception\WrongTokenException;
11use Shaarli\Security\SessionManager; 10use Shaarli\Security\SessionManager;
11use Shaarli\TestCase;
12use Slim\Http\Request; 12use Slim\Http\Request;
13use Slim\Http\Response; 13use Slim\Http\Response;
14 14
diff --git a/tests/front/controller/admin/PasswordControllerTest.php b/tests/front/controller/admin/PasswordControllerTest.php
index 9a01089e..58f47b49 100644
--- a/tests/front/controller/admin/PasswordControllerTest.php
+++ b/tests/front/controller/admin/PasswordControllerTest.php
@@ -4,11 +4,11 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin; 5namespace Shaarli\Front\Controller\Admin;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Config\ConfigManager; 7use Shaarli\Config\ConfigManager;
9use Shaarli\Front\Exception\OpenShaarliPasswordException; 8use Shaarli\Front\Exception\OpenShaarliPasswordException;
10use Shaarli\Front\Exception\WrongTokenException; 9use Shaarli\Front\Exception\WrongTokenException;
11use Shaarli\Security\SessionManager; 10use Shaarli\Security\SessionManager;
11use Shaarli\TestCase;
12use Slim\Http\Request; 12use Slim\Http\Request;
13use Slim\Http\Response; 13use Slim\Http\Response;
14 14
diff --git a/tests/front/controller/admin/PluginsControllerTest.php b/tests/front/controller/admin/PluginsControllerTest.php
index 9526474c..974d614d 100644
--- a/tests/front/controller/admin/PluginsControllerTest.php
+++ b/tests/front/controller/admin/PluginsControllerTest.php
@@ -4,11 +4,11 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin; 5namespace Shaarli\Front\Controller\Admin;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Config\ConfigManager; 7use Shaarli\Config\ConfigManager;
9use Shaarli\Front\Exception\WrongTokenException; 8use Shaarli\Front\Exception\WrongTokenException;
10use Shaarli\Plugin\PluginManager; 9use Shaarli\Plugin\PluginManager;
11use Shaarli\Security\SessionManager; 10use Shaarli\Security\SessionManager;
11use Shaarli\TestCase;
12use Slim\Http\Request; 12use Slim\Http\Request;
13use Slim\Http\Response; 13use Slim\Http\Response;
14 14
diff --git a/tests/front/controller/admin/SessionFilterControllerTest.php b/tests/front/controller/admin/SessionFilterControllerTest.php
index c4253167..712a625b 100644
--- a/tests/front/controller/admin/SessionFilterControllerTest.php
+++ b/tests/front/controller/admin/SessionFilterControllerTest.php
@@ -4,9 +4,9 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin; 5namespace Shaarli\Front\Controller\Admin;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Security\LoginManager; 7use Shaarli\Security\LoginManager;
9use Shaarli\Security\SessionManager; 8use Shaarli\Security\SessionManager;
9use Shaarli\TestCase;
10use Slim\Http\Request; 10use Slim\Http\Request;
11use Slim\Http\Response; 11use Slim\Http\Response;
12 12
diff --git a/tests/front/controller/admin/ShaarliAdminControllerTest.php b/tests/front/controller/admin/ShaarliAdminControllerTest.php
index fff427cb..486d5d2d 100644
--- a/tests/front/controller/admin/ShaarliAdminControllerTest.php
+++ b/tests/front/controller/admin/ShaarliAdminControllerTest.php
@@ -4,9 +4,9 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin; 5namespace Shaarli\Front\Controller\Admin;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Front\Exception\WrongTokenException; 7use Shaarli\Front\Exception\WrongTokenException;
9use Shaarli\Security\SessionManager; 8use Shaarli\Security\SessionManager;
9use Shaarli\TestCase;
10use Slim\Http\Request; 10use Slim\Http\Request;
11 11
12/** 12/**
diff --git a/tests/front/controller/admin/ThumbnailsControllerTest.php b/tests/front/controller/admin/ThumbnailsControllerTest.php
index 0c0c8a83..f4a8acff 100644
--- a/tests/front/controller/admin/ThumbnailsControllerTest.php
+++ b/tests/front/controller/admin/ThumbnailsControllerTest.php
@@ -4,9 +4,9 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin; 5namespace Shaarli\Front\Controller\Admin;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Bookmark\Bookmark; 7use Shaarli\Bookmark\Bookmark;
9use Shaarli\Bookmark\Exception\BookmarkNotFoundException; 8use Shaarli\Bookmark\Exception\BookmarkNotFoundException;
9use Shaarli\TestCase;
10use Shaarli\Thumbnailer; 10use Shaarli\Thumbnailer;
11use Slim\Http\Request; 11use Slim\Http\Request;
12use Slim\Http\Response; 12use Slim\Http\Response;
diff --git a/tests/front/controller/admin/TokenControllerTest.php b/tests/front/controller/admin/TokenControllerTest.php
index 04b0c0fa..d2f0907f 100644
--- a/tests/front/controller/admin/TokenControllerTest.php
+++ b/tests/front/controller/admin/TokenControllerTest.php
@@ -4,7 +4,7 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin; 5namespace Shaarli\Front\Controller\Admin;
6 6
7use PHPUnit\Framework\TestCase; 7use Shaarli\TestCase;
8use Slim\Http\Request; 8use Slim\Http\Request;
9use Slim\Http\Response; 9use Slim\Http\Response;
10 10
diff --git a/tests/front/controller/admin/ToolsControllerTest.php b/tests/front/controller/admin/ToolsControllerTest.php
index 39144d2f..e82f8b14 100644
--- a/tests/front/controller/admin/ToolsControllerTest.php
+++ b/tests/front/controller/admin/ToolsControllerTest.php
@@ -4,7 +4,7 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin; 5namespace Shaarli\Front\Controller\Admin;
6 6
7use PHPUnit\Framework\TestCase; 7use Shaarli\TestCase;
8use Slim\Http\Request; 8use Slim\Http\Request;
9use Slim\Http\Response; 9use Slim\Http\Response;
10 10
diff --git a/tests/front/controller/visitor/BookmarkListControllerTest.php b/tests/front/controller/visitor/BookmarkListControllerTest.php
index 5daaa2c4..0c95df97 100644
--- a/tests/front/controller/visitor/BookmarkListControllerTest.php
+++ b/tests/front/controller/visitor/BookmarkListControllerTest.php
@@ -4,11 +4,11 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Visitor; 5namespace Shaarli\Front\Controller\Visitor;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Bookmark\Bookmark; 7use Shaarli\Bookmark\Bookmark;
9use Shaarli\Bookmark\Exception\BookmarkNotFoundException; 8use Shaarli\Bookmark\Exception\BookmarkNotFoundException;
10use Shaarli\Config\ConfigManager; 9use Shaarli\Config\ConfigManager;
11use Shaarli\Security\LoginManager; 10use Shaarli\Security\LoginManager;
11use Shaarli\TestCase;
12use Shaarli\Thumbnailer; 12use Shaarli\Thumbnailer;
13use Slim\Http\Request; 13use Slim\Http\Request;
14use Slim\Http\Response; 14use Slim\Http\Response;
diff --git a/tests/front/controller/visitor/DailyControllerTest.php b/tests/front/controller/visitor/DailyControllerTest.php
index cb5b96f3..fc78bc13 100644
--- a/tests/front/controller/visitor/DailyControllerTest.php
+++ b/tests/front/controller/visitor/DailyControllerTest.php
@@ -4,9 +4,9 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Visitor; 5namespace Shaarli\Front\Controller\Visitor;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Bookmark\Bookmark; 7use Shaarli\Bookmark\Bookmark;
9use Shaarli\Feed\CachedPage; 8use Shaarli\Feed\CachedPage;
9use Shaarli\TestCase;
10use Slim\Http\Request; 10use Slim\Http\Request;
11use Slim\Http\Response; 11use Slim\Http\Response;
12 12
@@ -78,19 +78,20 @@ class DailyControllerTest extends TestCase
78 78
79 // Make sure that PluginManager hook is triggered 79 // Make sure that PluginManager hook is triggered
80 $this->container->pluginManager 80 $this->container->pluginManager
81 ->expects(static::at(0)) 81 ->expects(static::atLeastOnce())
82 ->method('executeHooks') 82 ->method('executeHooks')
83 ->withConsecutive(['render_daily'])
83 ->willReturnCallback(function (string $hook, array $data, array $param) use ($currentDay): array { 84 ->willReturnCallback(function (string $hook, array $data, array $param) use ($currentDay): array {
84 static::assertSame('render_daily', $hook); 85 if ('render_daily' === $hook) {
86 static::assertArrayHasKey('linksToDisplay', $data);
87 static::assertCount(3, $data['linksToDisplay']);
88 static::assertSame(1, $data['linksToDisplay'][0]['id']);
89 static::assertSame($currentDay->getTimestamp(), $data['day']);
90 static::assertSame('20200510', $data['previousday']);
91 static::assertSame('20200516', $data['nextday']);
85 92
86 static::assertArrayHasKey('linksToDisplay', $data); 93 static::assertArrayHasKey('loggedin', $param);
87 static::assertCount(3, $data['linksToDisplay']); 94 }
88 static::assertSame(1, $data['linksToDisplay'][0]['id']);
89 static::assertSame($currentDay->getTimestamp(), $data['day']);
90 static::assertSame('20200510', $data['previousday']);
91 static::assertSame('20200516', $data['nextday']);
92
93 static::assertArrayHasKey('loggedin', $param);
94 95
95 return $data; 96 return $data;
96 }) 97 })
@@ -203,19 +204,20 @@ class DailyControllerTest extends TestCase
203 204
204 // Make sure that PluginManager hook is triggered 205 // Make sure that PluginManager hook is triggered
205 $this->container->pluginManager 206 $this->container->pluginManager
206 ->expects(static::at(0)) 207 ->expects(static::atLeastOnce())
207 ->method('executeHooks') 208 ->method('executeHooks')
209 ->withConsecutive(['render_daily'])
208 ->willReturnCallback(function (string $hook, array $data, array $param) use ($currentDay): array { 210 ->willReturnCallback(function (string $hook, array $data, array $param) use ($currentDay): array {
209 static::assertSame('render_daily', $hook); 211 if ('render_daily' === $hook) {
210 212 static::assertArrayHasKey('linksToDisplay', $data);
211 static::assertArrayHasKey('linksToDisplay', $data); 213 static::assertCount(1, $data['linksToDisplay']);
212 static::assertCount(1, $data['linksToDisplay']); 214 static::assertSame(1, $data['linksToDisplay'][0]['id']);
213 static::assertSame(1, $data['linksToDisplay'][0]['id']); 215 static::assertSame($currentDay->getTimestamp(), $data['day']);
214 static::assertSame($currentDay->getTimestamp(), $data['day']); 216 static::assertEmpty($data['previousday']);
215 static::assertEmpty($data['previousday']); 217 static::assertEmpty($data['nextday']);
216 static::assertEmpty($data['nextday']);
217 218
218 static::assertArrayHasKey('loggedin', $param); 219 static::assertArrayHasKey('loggedin', $param);
220 }
219 221
220 return $data; 222 return $data;
221 }); 223 });
@@ -281,7 +283,7 @@ class DailyControllerTest extends TestCase
281 283
282 // Make sure that PluginManager hook is triggered 284 // Make sure that PluginManager hook is triggered
283 $this->container->pluginManager 285 $this->container->pluginManager
284 ->expects(static::at(0)) 286 ->expects(static::atLeastOnce())
285 ->method('executeHooks') 287 ->method('executeHooks')
286 ->willReturnCallback(function (string $hook, array $data, array $param): array { 288 ->willReturnCallback(function (string $hook, array $data, array $param): array {
287 return $data; 289 return $data;
@@ -333,7 +335,7 @@ class DailyControllerTest extends TestCase
333 335
334 // Make sure that PluginManager hook is triggered 336 // Make sure that PluginManager hook is triggered
335 $this->container->pluginManager 337 $this->container->pluginManager
336 ->expects(static::at(0)) 338 ->expects(static::atLeastOnce())
337 ->method('executeHooks') 339 ->method('executeHooks')
338 ->willReturnCallback(function (string $hook, array $data, array $param): array { 340 ->willReturnCallback(function (string $hook, array $data, array $param): array {
339 return $data; 341 return $data;
diff --git a/tests/front/controller/visitor/ErrorControllerTest.php b/tests/front/controller/visitor/ErrorControllerTest.php
index e497bfef..75408cf4 100644
--- a/tests/front/controller/visitor/ErrorControllerTest.php
+++ b/tests/front/controller/visitor/ErrorControllerTest.php
@@ -4,8 +4,8 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Visitor; 5namespace Shaarli\Front\Controller\Visitor;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Front\Exception\ShaarliFrontException; 7use Shaarli\Front\Exception\ShaarliFrontException;
8use Shaarli\TestCase;
9use Slim\Http\Request; 9use Slim\Http\Request;
10use Slim\Http\Response; 10use Slim\Http\Response;
11 11
diff --git a/tests/front/controller/visitor/ErrorNotFoundControllerTest.php b/tests/front/controller/visitor/ErrorNotFoundControllerTest.php
index 625467b1..a1cbbecf 100644
--- a/tests/front/controller/visitor/ErrorNotFoundControllerTest.php
+++ b/tests/front/controller/visitor/ErrorNotFoundControllerTest.php
@@ -4,7 +4,7 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Visitor; 5namespace Shaarli\Front\Controller\Visitor;
6 6
7use PHPUnit\Framework\TestCase; 7use Shaarli\TestCase;
8use Slim\Http\Request; 8use Slim\Http\Request;
9use Slim\Http\Response; 9use Slim\Http\Response;
10use Slim\Http\Uri; 10use Slim\Http\Uri;
diff --git a/tests/front/controller/visitor/FeedControllerTest.php b/tests/front/controller/visitor/FeedControllerTest.php
index 0a6b577f..4ae7c925 100644
--- a/tests/front/controller/visitor/FeedControllerTest.php
+++ b/tests/front/controller/visitor/FeedControllerTest.php
@@ -4,8 +4,8 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Visitor; 5namespace Shaarli\Front\Controller\Visitor;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Feed\FeedBuilder; 7use Shaarli\Feed\FeedBuilder;
8use Shaarli\TestCase;
9use Slim\Http\Request; 9use Slim\Http\Request;
10use Slim\Http\Response; 10use Slim\Http\Response;
11 11
@@ -45,14 +45,16 @@ class FeedControllerTest extends TestCase
45 45
46 // Make sure that PluginManager hook is triggered 46 // Make sure that PluginManager hook is triggered
47 $this->container->pluginManager 47 $this->container->pluginManager
48 ->expects(static::at(0)) 48 ->expects(static::atLeastOnce())
49 ->method('executeHooks') 49 ->method('executeHooks')
50 ->withConsecutive(['render_feed'])
50 ->willReturnCallback(function (string $hook, array $data, array $param): void { 51 ->willReturnCallback(function (string $hook, array $data, array $param): void {
51 static::assertSame('render_feed', $hook); 52 if ('render_feed' === $hook) {
52 static::assertSame('data', $data['content']); 53 static::assertSame('data', $data['content']);
53 54
54 static::assertArrayHasKey('loggedin', $param); 55 static::assertArrayHasKey('loggedin', $param);
55 static::assertSame('feed.rss', $param['target']); 56 static::assertSame('feed.rss', $param['target']);
57 }
56 }) 58 })
57 ; 59 ;
58 60
@@ -84,14 +86,16 @@ class FeedControllerTest extends TestCase
84 86
85 // Make sure that PluginManager hook is triggered 87 // Make sure that PluginManager hook is triggered
86 $this->container->pluginManager 88 $this->container->pluginManager
87 ->expects(static::at(0)) 89 ->expects(static::atLeastOnce())
88 ->method('executeHooks') 90 ->method('executeHooks')
91 ->withConsecutive(['render_feed'])
89 ->willReturnCallback(function (string $hook, array $data, array $param): void { 92 ->willReturnCallback(function (string $hook, array $data, array $param): void {
90 static::assertSame('render_feed', $hook); 93 if ('render_feed' === $hook) {
91 static::assertSame('data', $data['content']); 94 static::assertSame('data', $data['content']);
92 95
93 static::assertArrayHasKey('loggedin', $param); 96 static::assertArrayHasKey('loggedin', $param);
94 static::assertSame('feed.atom', $param['target']); 97 static::assertSame('feed.atom', $param['target']);
98 }
95 }) 99 })
96 ; 100 ;
97 101
@@ -124,14 +128,16 @@ class FeedControllerTest extends TestCase
124 128
125 // Make sure that PluginManager hook is triggered 129 // Make sure that PluginManager hook is triggered
126 $this->container->pluginManager 130 $this->container->pluginManager
127 ->expects(static::at(0)) 131 ->expects(static::atLeastOnce())
128 ->method('executeHooks') 132 ->method('executeHooks')
133 ->withConsecutive(['render_feed'])
129 ->willReturnCallback(function (string $hook, array $data, array $param): void { 134 ->willReturnCallback(function (string $hook, array $data, array $param): void {
130 static::assertSame('render_feed', $hook); 135 if ('render_feed' === $hook) {
131 static::assertSame('data', $data['content']); 136 static::assertSame('data', $data['content']);
132 137
133 static::assertArrayHasKey('loggedin', $param); 138 static::assertArrayHasKey('loggedin', $param);
134 static::assertSame('feed.atom', $param['target']); 139 static::assertSame('feed.atom', $param['target']);
140 }
135 }) 141 })
136 ; 142 ;
137 143
diff --git a/tests/front/controller/visitor/FrontControllerMockHelper.php b/tests/front/controller/visitor/FrontControllerMockHelper.php
index 6c53289b..fc0bb7d1 100644
--- a/tests/front/controller/visitor/FrontControllerMockHelper.php
+++ b/tests/front/controller/visitor/FrontControllerMockHelper.php
@@ -4,7 +4,6 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Visitor; 5namespace Shaarli\Front\Controller\Visitor;
6 6
7use PHPUnit\Framework\MockObject\MockObject;
8use Shaarli\Bookmark\BookmarkServiceInterface; 7use Shaarli\Bookmark\BookmarkServiceInterface;
9use Shaarli\Config\ConfigManager; 8use Shaarli\Config\ConfigManager;
10use Shaarli\Container\ShaarliTestContainer; 9use Shaarli\Container\ShaarliTestContainer;
@@ -115,5 +114,5 @@ trait FrontControllerMockHelper
115 /** 114 /**
116 * Force to be used in PHPUnit context. 115 * Force to be used in PHPUnit context.
117 */ 116 */
118 protected abstract function createMock($originalClassName): MockObject; 117 protected abstract function isInTestsContext(): bool;
119} 118}
diff --git a/tests/front/controller/visitor/InstallControllerTest.php b/tests/front/controller/visitor/InstallControllerTest.php
index 994d3f33..345ad544 100644
--- a/tests/front/controller/visitor/InstallControllerTest.php
+++ b/tests/front/controller/visitor/InstallControllerTest.php
@@ -4,10 +4,10 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Visitor; 5namespace Shaarli\Front\Controller\Visitor;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Config\ConfigManager; 7use Shaarli\Config\ConfigManager;
9use Shaarli\Front\Exception\AlreadyInstalledException; 8use Shaarli\Front\Exception\AlreadyInstalledException;
10use Shaarli\Security\SessionManager; 9use Shaarli\Security\SessionManager;
10use Shaarli\TestCase;
11use Slim\Http\Request; 11use Slim\Http\Request;
12use Slim\Http\Response; 12use Slim\Http\Response;
13 13
diff --git a/tests/front/controller/visitor/LoginControllerTest.php b/tests/front/controller/visitor/LoginControllerTest.php
index 0a21f938..1312ccb7 100644
--- a/tests/front/controller/visitor/LoginControllerTest.php
+++ b/tests/front/controller/visitor/LoginControllerTest.php
@@ -4,13 +4,13 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Visitor; 5namespace Shaarli\Front\Controller\Visitor;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Config\ConfigManager; 7use Shaarli\Config\ConfigManager;
9use Shaarli\Front\Exception\LoginBannedException; 8use Shaarli\Front\Exception\LoginBannedException;
10use Shaarli\Front\Exception\WrongTokenException; 9use Shaarli\Front\Exception\WrongTokenException;
11use Shaarli\Render\TemplatePage; 10use Shaarli\Render\TemplatePage;
12use Shaarli\Security\CookieManager; 11use Shaarli\Security\CookieManager;
13use Shaarli\Security\SessionManager; 12use Shaarli\Security\SessionManager;
13use Shaarli\TestCase;
14use Slim\Http\Request; 14use Slim\Http\Request;
15use Slim\Http\Response; 15use Slim\Http\Response;
16 16
diff --git a/tests/front/controller/visitor/OpenSearchControllerTest.php b/tests/front/controller/visitor/OpenSearchControllerTest.php
index 9609a377..42d876c3 100644
--- a/tests/front/controller/visitor/OpenSearchControllerTest.php
+++ b/tests/front/controller/visitor/OpenSearchControllerTest.php
@@ -4,7 +4,7 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Visitor; 5namespace Shaarli\Front\Controller\Visitor;
6 6
7use PHPUnit\Framework\TestCase; 7use Shaarli\TestCase;
8use Slim\Http\Request; 8use Slim\Http\Request;
9use Slim\Http\Response; 9use Slim\Http\Response;
10 10
diff --git a/tests/front/controller/visitor/PictureWallControllerTest.php b/tests/front/controller/visitor/PictureWallControllerTest.php
index 3dc3f292..b868231d 100644
--- a/tests/front/controller/visitor/PictureWallControllerTest.php
+++ b/tests/front/controller/visitor/PictureWallControllerTest.php
@@ -4,10 +4,10 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Visitor; 5namespace Shaarli\Front\Controller\Visitor;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Bookmark\Bookmark; 7use Shaarli\Bookmark\Bookmark;
9use Shaarli\Config\ConfigManager; 8use Shaarli\Config\ConfigManager;
10use Shaarli\Front\Exception\ThumbnailsDisabledException; 9use Shaarli\Front\Exception\ThumbnailsDisabledException;
10use Shaarli\TestCase;
11use Shaarli\Thumbnailer; 11use Shaarli\Thumbnailer;
12use Slim\Http\Request; 12use Slim\Http\Request;
13use Slim\Http\Response; 13use Slim\Http\Response;
@@ -67,15 +67,17 @@ class PictureWallControllerTest extends TestCase
67 67
68 // Make sure that PluginManager hook is triggered 68 // Make sure that PluginManager hook is triggered
69 $this->container->pluginManager 69 $this->container->pluginManager
70 ->expects(static::at(0)) 70 ->expects(static::atLeastOnce())
71 ->method('executeHooks') 71 ->method('executeHooks')
72 ->withConsecutive(['render_picwall'])
72 ->willReturnCallback(function (string $hook, array $data, array $param): array { 73 ->willReturnCallback(function (string $hook, array $data, array $param): array {
73 static::assertSame('render_picwall', $hook); 74 if ('render_picwall' === $hook) {
74 static::assertArrayHasKey('linksToDisplay', $data); 75 static::assertArrayHasKey('linksToDisplay', $data);
75 static::assertCount(2, $data['linksToDisplay']); 76 static::assertCount(2, $data['linksToDisplay']);
76 static::assertSame(1, $data['linksToDisplay'][0]['id']); 77 static::assertSame(1, $data['linksToDisplay'][0]['id']);
77 static::assertSame(3, $data['linksToDisplay'][1]['id']); 78 static::assertSame(3, $data['linksToDisplay'][1]['id']);
78 static::assertArrayHasKey('loggedin', $param); 79 static::assertArrayHasKey('loggedin', $param);
80 }
79 81
80 return $data; 82 return $data;
81 }); 83 });
diff --git a/tests/front/controller/visitor/PublicSessionFilterControllerTest.php b/tests/front/controller/visitor/PublicSessionFilterControllerTest.php
index b45fbe53..7e3b00af 100644
--- a/tests/front/controller/visitor/PublicSessionFilterControllerTest.php
+++ b/tests/front/controller/visitor/PublicSessionFilterControllerTest.php
@@ -4,8 +4,8 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Visitor; 5namespace Shaarli\Front\Controller\Visitor;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Security\SessionManager; 7use Shaarli\Security\SessionManager;
8use Shaarli\TestCase;
9use Slim\Http\Request; 9use Slim\Http\Request;
10use Slim\Http\Response; 10use Slim\Http\Response;
11 11
diff --git a/tests/front/controller/visitor/ShaarliVisitorControllerTest.php b/tests/front/controller/visitor/ShaarliVisitorControllerTest.php
index 00188c02..935ec24e 100644
--- a/tests/front/controller/visitor/ShaarliVisitorControllerTest.php
+++ b/tests/front/controller/visitor/ShaarliVisitorControllerTest.php
@@ -4,8 +4,8 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Visitor; 5namespace Shaarli\Front\Controller\Visitor;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Bookmark\BookmarkFilter; 7use Shaarli\Bookmark\BookmarkFilter;
8use Shaarli\TestCase;
9use Slim\Http\Request; 9use Slim\Http\Request;
10use Slim\Http\Response; 10use Slim\Http\Response;
11 11
diff --git a/tests/front/controller/visitor/TagCloudControllerTest.php b/tests/front/controller/visitor/TagCloudControllerTest.php
index 9a6a4bc0..9305612e 100644
--- a/tests/front/controller/visitor/TagCloudControllerTest.php
+++ b/tests/front/controller/visitor/TagCloudControllerTest.php
@@ -4,8 +4,8 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Visitor; 5namespace Shaarli\Front\Controller\Visitor;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Bookmark\BookmarkFilter; 7use Shaarli\Bookmark\BookmarkFilter;
8use Shaarli\TestCase;
9use Slim\Http\Request; 9use Slim\Http\Request;
10use Slim\Http\Response; 10use Slim\Http\Response;
11 11
@@ -53,14 +53,16 @@ class TagCloudControllerTest extends TestCase
53 53
54 // Make sure that PluginManager hook is triggered 54 // Make sure that PluginManager hook is triggered
55 $this->container->pluginManager 55 $this->container->pluginManager
56 ->expects(static::at(0)) 56 ->expects(static::atLeastOnce())
57 ->method('executeHooks') 57 ->method('executeHooks')
58 ->withConsecutive(['render_tagcloud'])
58 ->willReturnCallback(function (string $hook, array $data, array $param): array { 59 ->willReturnCallback(function (string $hook, array $data, array $param): array {
59 static::assertSame('render_tagcloud', $hook); 60 if ('render_tagcloud' === $hook) {
60 static::assertSame('', $data['search_tags']); 61 static::assertSame('', $data['search_tags']);
61 static::assertCount(3, $data['tags']); 62 static::assertCount(3, $data['tags']);
62 63
63 static::assertArrayHasKey('loggedin', $param); 64 static::assertArrayHasKey('loggedin', $param);
65 }
64 66
65 return $data; 67 return $data;
66 }) 68 })
@@ -124,14 +126,16 @@ class TagCloudControllerTest extends TestCase
124 126
125 // Make sure that PluginManager hook is triggered 127 // Make sure that PluginManager hook is triggered
126 $this->container->pluginManager 128 $this->container->pluginManager
127 ->expects(static::at(0)) 129 ->expects(static::atLeastOnce())
128 ->method('executeHooks') 130 ->method('executeHooks')
131 ->withConsecutive(['render_tagcloud'])
129 ->willReturnCallback(function (string $hook, array $data, array $param): array { 132 ->willReturnCallback(function (string $hook, array $data, array $param): array {
130 static::assertSame('render_tagcloud', $hook); 133 if ('render_tagcloud' === $hook) {
131 static::assertSame('ghi def', $data['search_tags']); 134 static::assertSame('ghi def', $data['search_tags']);
132 static::assertCount(1, $data['tags']); 135 static::assertCount(1, $data['tags']);
133 136
134 static::assertArrayHasKey('loggedin', $param); 137 static::assertArrayHasKey('loggedin', $param);
138 }
135 139
136 return $data; 140 return $data;
137 }) 141 })
@@ -175,14 +179,16 @@ class TagCloudControllerTest extends TestCase
175 179
176 // Make sure that PluginManager hook is triggered 180 // Make sure that PluginManager hook is triggered
177 $this->container->pluginManager 181 $this->container->pluginManager
178 ->expects(static::at(0)) 182 ->expects(static::atLeastOnce())
179 ->method('executeHooks') 183 ->method('executeHooks')
184 ->withConsecutive(['render_tagcloud'])
180 ->willReturnCallback(function (string $hook, array $data, array $param): array { 185 ->willReturnCallback(function (string $hook, array $data, array $param): array {
181 static::assertSame('render_tagcloud', $hook); 186 if ('render_tagcloud' === $hook) {
182 static::assertSame('', $data['search_tags']); 187 static::assertSame('', $data['search_tags']);
183 static::assertCount(0, $data['tags']); 188 static::assertCount(0, $data['tags']);
184 189
185 static::assertArrayHasKey('loggedin', $param); 190 static::assertArrayHasKey('loggedin', $param);
191 }
186 192
187 return $data; 193 return $data;
188 }) 194 })
@@ -227,14 +233,16 @@ class TagCloudControllerTest extends TestCase
227 233
228 // Make sure that PluginManager hook is triggered 234 // Make sure that PluginManager hook is triggered
229 $this->container->pluginManager 235 $this->container->pluginManager
230 ->expects(static::at(0)) 236 ->expects(static::atLeastOnce())
231 ->method('executeHooks') 237 ->method('executeHooks')
238 ->withConsecutive(['render_taglist'])
232 ->willReturnCallback(function (string $hook, array $data, array $param): array { 239 ->willReturnCallback(function (string $hook, array $data, array $param): array {
233 static::assertSame('render_taglist', $hook); 240 if ('render_taglist' === $hook) {
234 static::assertSame('', $data['search_tags']); 241 static::assertSame('', $data['search_tags']);
235 static::assertCount(3, $data['tags']); 242 static::assertCount(3, $data['tags']);
236 243
237 static::assertArrayHasKey('loggedin', $param); 244 static::assertArrayHasKey('loggedin', $param);
245 }
238 246
239 return $data; 247 return $data;
240 }) 248 })
@@ -297,14 +305,16 @@ class TagCloudControllerTest extends TestCase
297 305
298 // Make sure that PluginManager hook is triggered 306 // Make sure that PluginManager hook is triggered
299 $this->container->pluginManager 307 $this->container->pluginManager
300 ->expects(static::at(0)) 308 ->expects(static::atLeastOnce())
301 ->method('executeHooks') 309 ->method('executeHooks')
310 ->withConsecutive(['render_taglist'])
302 ->willReturnCallback(function (string $hook, array $data, array $param): array { 311 ->willReturnCallback(function (string $hook, array $data, array $param): array {
303 static::assertSame('render_taglist', $hook); 312 if ('render_taglist' === $hook) {
304 static::assertSame('ghi def', $data['search_tags']); 313 static::assertSame('ghi def', $data['search_tags']);
305 static::assertCount(1, $data['tags']); 314 static::assertCount(1, $data['tags']);
306 315
307 static::assertArrayHasKey('loggedin', $param); 316 static::assertArrayHasKey('loggedin', $param);
317 }
308 318
309 return $data; 319 return $data;
310 }) 320 })
@@ -344,14 +354,16 @@ class TagCloudControllerTest extends TestCase
344 354
345 // Make sure that PluginManager hook is triggered 355 // Make sure that PluginManager hook is triggered
346 $this->container->pluginManager 356 $this->container->pluginManager
347 ->expects(static::at(0)) 357 ->expects(static::atLeastOnce())
348 ->method('executeHooks') 358 ->method('executeHooks')
359 ->withConsecutive(['render_taglist'])
349 ->willReturnCallback(function (string $hook, array $data, array $param): array { 360 ->willReturnCallback(function (string $hook, array $data, array $param): array {
350 static::assertSame('render_taglist', $hook); 361 if ('render_taglist' === $hook) {
351 static::assertSame('', $data['search_tags']); 362 static::assertSame('', $data['search_tags']);
352 static::assertCount(0, $data['tags']); 363 static::assertCount(0, $data['tags']);
353 364
354 static::assertArrayHasKey('loggedin', $param); 365 static::assertArrayHasKey('loggedin', $param);
366 }
355 367
356 return $data; 368 return $data;
357 }) 369 })
diff --git a/tests/front/controller/visitor/TagControllerTest.php b/tests/front/controller/visitor/TagControllerTest.php
index 43076086..750ea02d 100644
--- a/tests/front/controller/visitor/TagControllerTest.php
+++ b/tests/front/controller/visitor/TagControllerTest.php
@@ -4,7 +4,7 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Visitor; 5namespace Shaarli\Front\Controller\Visitor;
6 6
7use PHPUnit\Framework\TestCase; 7use Shaarli\TestCase;
8use Slim\Http\Request; 8use Slim\Http\Request;
9use Slim\Http\Response; 9use Slim\Http\Response;
10 10