diff options
Diffstat (limited to 'tests/front/controller/visitor/PictureWallControllerTest.php')
-rw-r--r-- | tests/front/controller/visitor/PictureWallControllerTest.php | 18 |
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 | ||
5 | namespace Shaarli\Front\Controller\Visitor; | 5 | namespace Shaarli\Front\Controller\Visitor; |
6 | 6 | ||
7 | use PHPUnit\Framework\TestCase; | ||
8 | use Shaarli\Bookmark\Bookmark; | 7 | use Shaarli\Bookmark\Bookmark; |
9 | use Shaarli\Config\ConfigManager; | 8 | use Shaarli\Config\ConfigManager; |
10 | use Shaarli\Front\Exception\ThumbnailsDisabledException; | 9 | use Shaarli\Front\Exception\ThumbnailsDisabledException; |
10 | use Shaarli\TestCase; | ||
11 | use Shaarli\Thumbnailer; | 11 | use Shaarli\Thumbnailer; |
12 | use Slim\Http\Request; | 12 | use Slim\Http\Request; |
13 | use Slim\Http\Response; | 13 | use 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 | }); |