diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-01-23 20:06:32 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-01-26 11:34:14 +0100 |
commit | 0498b209b551cad5595312583e5d6fb1bc3303a5 (patch) | |
tree | a7b176fc39788bc7f5eef1ddcd18877d2defdfd9 /tests/front/controller/LoginControllerTest.php | |
parent | 9e4cc28e2957e1f7df713d52a03e350d728dc58e (diff) | |
download | Shaarli-0498b209b551cad5595312583e5d6fb1bc3303a5.tar.gz Shaarli-0498b209b551cad5595312583e5d6fb1bc3303a5.tar.zst Shaarli-0498b209b551cad5595312583e5d6fb1bc3303a5.zip |
Execute common plugin hooks before rendering login page
Diffstat (limited to 'tests/front/controller/LoginControllerTest.php')
-rw-r--r-- | tests/front/controller/LoginControllerTest.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/front/controller/LoginControllerTest.php b/tests/front/controller/LoginControllerTest.php index ddcfe154..8cf8ece7 100644 --- a/tests/front/controller/LoginControllerTest.php +++ b/tests/front/controller/LoginControllerTest.php | |||
@@ -5,9 +5,11 @@ declare(strict_types=1); | |||
5 | namespace Shaarli\Front\Controller; | 5 | namespace Shaarli\Front\Controller; |
6 | 6 | ||
7 | use PHPUnit\Framework\TestCase; | 7 | use PHPUnit\Framework\TestCase; |
8 | use Shaarli\Bookmark\BookmarkServiceInterface; | ||
8 | use Shaarli\Config\ConfigManager; | 9 | use Shaarli\Config\ConfigManager; |
9 | use Shaarli\Container\ShaarliContainer; | 10 | use Shaarli\Container\ShaarliContainer; |
10 | use Shaarli\Front\Exception\LoginBannedException; | 11 | use Shaarli\Front\Exception\LoginBannedException; |
12 | use Shaarli\Plugin\PluginManager; | ||
11 | use Shaarli\Render\PageBuilder; | 13 | use Shaarli\Render\PageBuilder; |
12 | use Shaarli\Security\LoginManager; | 14 | use Shaarli\Security\LoginManager; |
13 | use Slim\Http\Request; | 15 | use Slim\Http\Request; |
@@ -37,7 +39,6 @@ class LoginControllerTest extends TestCase | |||
37 | 39 | ||
38 | $assignedVariables = []; | 40 | $assignedVariables = []; |
39 | $this->container->pageBuilder | 41 | $this->container->pageBuilder |
40 | ->expects(static::exactly(3)) | ||
41 | ->method('assign') | 42 | ->method('assign') |
42 | ->willReturnCallback(function ($key, $value) use (&$assignedVariables) { | 43 | ->willReturnCallback(function ($key, $value) use (&$assignedVariables) { |
43 | $assignedVariables[$key] = $value; | 44 | $assignedVariables[$key] = $value; |
@@ -68,7 +69,6 @@ class LoginControllerTest extends TestCase | |||
68 | 69 | ||
69 | $assignedVariables = []; | 70 | $assignedVariables = []; |
70 | $this->container->pageBuilder | 71 | $this->container->pageBuilder |
71 | ->expects(static::exactly(4)) | ||
72 | ->method('assign') | 72 | ->method('assign') |
73 | ->willReturnCallback(function ($key, $value) use (&$assignedVariables) { | 73 | ->willReturnCallback(function ($key, $value) use (&$assignedVariables) { |
74 | $assignedVariables[$key] = $value; | 74 | $assignedVariables[$key] = $value; |
@@ -169,5 +169,10 @@ class LoginControllerTest extends TestCase | |||
169 | }) | 169 | }) |
170 | ; | 170 | ; |
171 | $this->container->pageBuilder = $pageBuilder; | 171 | $this->container->pageBuilder = $pageBuilder; |
172 | |||
173 | $pluginManager = $this->createMock(PluginManager::class); | ||
174 | $this->container->pluginManager = $pluginManager; | ||
175 | $bookmarkService = $this->createMock(BookmarkServiceInterface::class); | ||
176 | $this->container->bookmarkService = $bookmarkService; | ||
172 | } | 177 | } |
173 | } | 178 | } |