aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/front/controller/visitor/PictureWallControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/front/controller/visitor/PictureWallControllerTest.php')
-rw-r--r--tests/front/controller/visitor/PictureWallControllerTest.php18
1 files changed, 10 insertions, 8 deletions
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 });