From 0498b209b551cad5595312583e5d6fb1bc3303a5 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Thu, 23 Jan 2020 20:06:32 +0100 Subject: Execute common plugin hooks before rendering login page --- tests/front/controller/LoginControllerTest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/front/controller/LoginControllerTest.php') 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); namespace Shaarli\Front\Controller; use PHPUnit\Framework\TestCase; +use Shaarli\Bookmark\BookmarkServiceInterface; use Shaarli\Config\ConfigManager; use Shaarli\Container\ShaarliContainer; use Shaarli\Front\Exception\LoginBannedException; +use Shaarli\Plugin\PluginManager; use Shaarli\Render\PageBuilder; use Shaarli\Security\LoginManager; use Slim\Http\Request; @@ -37,7 +39,6 @@ class LoginControllerTest extends TestCase $assignedVariables = []; $this->container->pageBuilder - ->expects(static::exactly(3)) ->method('assign') ->willReturnCallback(function ($key, $value) use (&$assignedVariables) { $assignedVariables[$key] = $value; @@ -68,7 +69,6 @@ class LoginControllerTest extends TestCase $assignedVariables = []; $this->container->pageBuilder - ->expects(static::exactly(4)) ->method('assign') ->willReturnCallback(function ($key, $value) use (&$assignedVariables) { $assignedVariables[$key] = $value; @@ -169,5 +169,10 @@ class LoginControllerTest extends TestCase }) ; $this->container->pageBuilder = $pageBuilder; + + $pluginManager = $this->createMock(PluginManager::class); + $this->container->pluginManager = $pluginManager; + $bookmarkService = $this->createMock(BookmarkServiceInterface::class); + $this->container->bookmarkService = $bookmarkService; } } -- cgit v1.2.3