aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/front/controller/LoginControllerTest.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-01-23 20:06:32 +0100
committerArthurHoaro <arthur@hoa.ro>2020-01-26 11:34:14 +0100
commit0498b209b551cad5595312583e5d6fb1bc3303a5 (patch)
treea7b176fc39788bc7f5eef1ddcd18877d2defdfd9 /tests/front/controller/LoginControllerTest.php
parent9e4cc28e2957e1f7df713d52a03e350d728dc58e (diff)
downloadShaarli-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.php9
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);
5namespace Shaarli\Front\Controller; 5namespace Shaarli\Front\Controller;
6 6
7use PHPUnit\Framework\TestCase; 7use PHPUnit\Framework\TestCase;
8use Shaarli\Bookmark\BookmarkServiceInterface;
8use Shaarli\Config\ConfigManager; 9use Shaarli\Config\ConfigManager;
9use Shaarli\Container\ShaarliContainer; 10use Shaarli\Container\ShaarliContainer;
10use Shaarli\Front\Exception\LoginBannedException; 11use Shaarli\Front\Exception\LoginBannedException;
12use Shaarli\Plugin\PluginManager;
11use Shaarli\Render\PageBuilder; 13use Shaarli\Render\PageBuilder;
12use Shaarli\Security\LoginManager; 14use Shaarli\Security\LoginManager;
13use Slim\Http\Request; 15use 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}