aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/front/controller/visitor/PictureWallControllerTest.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2021-01-20 14:45:59 +0100
committerArthurHoaro <arthur@hoa.ro>2021-01-20 15:01:29 +0100
commit9b8c0a4560fa1d87cab1529099b1b4677e92e265 (patch)
tree330a9b1a42ff7b7f24a76612b57fae63417ef483 /tests/front/controller/visitor/PictureWallControllerTest.php
parent055d97f9a9e67d8ee8ae81bbf59a4b846a145d9f (diff)
downloadShaarli-9b8c0a4560fa1d87cab1529099b1b4677e92e265.tar.gz
Shaarli-9b8c0a4560fa1d87cab1529099b1b4677e92e265.tar.zst
Shaarli-9b8c0a4560fa1d87cab1529099b1b4677e92e265.zip
Handle pagination through BookmarkService
Handle all search results through SearchResult object. This is a required step toward implementing a BookmarkService based on SQL database. Related to #953
Diffstat (limited to 'tests/front/controller/visitor/PictureWallControllerTest.php')
-rw-r--r--tests/front/controller/visitor/PictureWallControllerTest.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/front/controller/visitor/PictureWallControllerTest.php b/tests/front/controller/visitor/PictureWallControllerTest.php
index b868231d..429e99a2 100644
--- a/tests/front/controller/visitor/PictureWallControllerTest.php
+++ b/tests/front/controller/visitor/PictureWallControllerTest.php
@@ -5,6 +5,7 @@ declare(strict_types=1);
5namespace Shaarli\Front\Controller\Visitor; 5namespace Shaarli\Front\Controller\Visitor;
6 6
7use Shaarli\Bookmark\Bookmark; 7use Shaarli\Bookmark\Bookmark;
8use Shaarli\Bookmark\SearchResult;
8use Shaarli\Config\ConfigManager; 9use Shaarli\Config\ConfigManager;
9use Shaarli\Front\Exception\ThumbnailsDisabledException; 10use Shaarli\Front\Exception\ThumbnailsDisabledException;
10use Shaarli\TestCase; 11use Shaarli\TestCase;
@@ -50,17 +51,17 @@ class PictureWallControllerTest extends TestCase
50 $this->container->bookmarkService 51 $this->container->bookmarkService
51 ->expects(static::once()) 52 ->expects(static::once())
52 ->method('search') 53 ->method('search')
53 ->willReturnCallback(function (array $parameters, ?string $visibility): array { 54 ->willReturnCallback(function (array $parameters, ?string $visibility): SearchResult {
54 // Visibility is set through the container, not the call 55 // Visibility is set through the container, not the call
55 static::assertNull($visibility); 56 static::assertNull($visibility);
56 57
57 // No query parameters 58 // No query parameters
58 if (count($parameters) === 0) { 59 if (count($parameters) === 0) {
59 return [ 60 return SearchResult::getSearchResult([
60 (new Bookmark())->setId(1)->setUrl('http://url.tld')->setThumbnail('thumb1'), 61 (new Bookmark())->setId(1)->setUrl('http://url.tld')->setThumbnail('thumb1'),
61 (new Bookmark())->setId(2)->setUrl('http://url2.tld'), 62 (new Bookmark())->setId(2)->setUrl('http://url2.tld'),
62 (new Bookmark())->setId(3)->setUrl('http://url3.tld')->setThumbnail('thumb2'), 63 (new Bookmark())->setId(3)->setUrl('http://url3.tld')->setThumbnail('thumb2'),
63 ]; 64 ]);
64 } 65 }
65 }) 66 })
66 ; 67 ;