aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/front/controller/visitor/PictureWallControllerTest.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-10-03 12:59:16 +0200
committerGitHub <noreply@github.com>2020-10-03 12:59:16 +0200
commit7b18876361f2223672f3a2cac9fc0da16d12d69f (patch)
tree03a655c46d801d56211fb05cc2930824dace4565 /tests/front/controller/visitor/PictureWallControllerTest.php
parentee07b7283faa197fc062ed85f4f96f98e8e77b03 (diff)
parentd246e2c5129fe8d3f8e1429b4e8ff8e3e486c779 (diff)
downloadShaarli-7b18876361f2223672f3a2cac9fc0da16d12d69f.tar.gz
Shaarli-7b18876361f2223672f3a2cac9fc0da16d12d69f.tar.zst
Shaarli-7b18876361f2223672f3a2cac9fc0da16d12d69f.zip
Merge pull request #1575 from ArthurHoaro/feature/php8
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 });