From 9fbc42294e7667c5ef19cafa0d1fcfbc1c0f36a9 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 26 Jul 2020 14:43:10 +0200 Subject: New basePath: fix officiel plugin paths and vintage template --- .../DeleteBookmarkTest.php | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'tests/front/controller/admin/ManageShaareControllerTest') diff --git a/tests/front/controller/admin/ManageShaareControllerTest/DeleteBookmarkTest.php b/tests/front/controller/admin/ManageShaareControllerTest/DeleteBookmarkTest.php index caaf549d..dee622bb 100644 --- a/tests/front/controller/admin/ManageShaareControllerTest/DeleteBookmarkTest.php +++ b/tests/front/controller/admin/ManageShaareControllerTest/DeleteBookmarkTest.php @@ -59,8 +59,12 @@ class DeleteBookmarkTest extends TestCase ->with('raw') ->willReturnCallback(function () use ($bookmark): BookmarkFormatter { $formatter = $this->createMock(BookmarkFormatter::class); - - $formatter->expects(static::once())->method('format')->with($bookmark); + $formatter + ->expects(static::once()) + ->method('format') + ->with($bookmark) + ->willReturn(['formatted' => $bookmark]) + ; return $formatter; }) @@ -70,7 +74,7 @@ class DeleteBookmarkTest extends TestCase $this->container->pluginManager ->expects(static::once()) ->method('executeHooks') - ->with('delete_link') + ->with('delete_link', ['formatted' => $bookmark]) ; $result = $this->controller->deleteBookmark($request, $response); @@ -129,6 +133,9 @@ class DeleteBookmarkTest extends TestCase ->withConsecutive(...array_map(function (Bookmark $bookmark): array { return [$bookmark]; }, $bookmarks)) + ->willReturnOnConsecutiveCalls(...array_map(function (Bookmark $bookmark): array { + return ['formatted' => $bookmark]; + }, $bookmarks)) ; return $formatter; @@ -254,6 +261,9 @@ class DeleteBookmarkTest extends TestCase ->withConsecutive(...array_map(function (Bookmark $bookmark): array { return [$bookmark]; }, $bookmarks)) + ->willReturnOnConsecutiveCalls(...array_map(function (Bookmark $bookmark): array { + return ['formatted' => $bookmark]; + }, $bookmarks)) ; return $formatter; @@ -350,7 +360,12 @@ class DeleteBookmarkTest extends TestCase $this->container->formatterFactory ->expects(static::once()) ->method('getFormatter') - ->willReturn($this->createMock(BookmarkFormatter::class)) + ->willReturnCallback(function (): BookmarkFormatter { + $formatter = $this->createMock(BookmarkFormatter::class); + $formatter->method('format')->willReturn(['formatted']); + + return $formatter; + }) ; $result = $this->controller->deleteBookmark($request, $response); -- cgit v1.2.3