diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-09-29 14:41:40 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-09-29 18:57:20 +0200 |
commit | a5a9cf23acd1248585173aa32757d9720b5f2d62 (patch) | |
tree | 5b443e09fc0f84db0cb478cda0c88c10346b0843 /tests/front/controller/visitor/PictureWallControllerTest.php | |
parent | 2b7a7bc928fb7fc171138e248d3aa1d86d5b62f9 (diff) | |
download | Shaarli-a5a9cf23acd1248585173aa32757d9720b5f2d62.tar.gz Shaarli-a5a9cf23acd1248585173aa32757d9720b5f2d62.tar.zst Shaarli-a5a9cf23acd1248585173aa32757d9720b5f2d62.zip |
Compatibility with PHPUnit 9
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 | }); |