aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php')
-rw-r--r--tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php20
1 files changed, 15 insertions, 5 deletions
diff --git a/tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php b/tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php
index f7a68226..37542c26 100644
--- a/tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php
+++ b/tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php
@@ -66,23 +66,27 @@ class SaveBookmarkTest extends TestCase
66 $this->container->bookmarkService 66 $this->container->bookmarkService
67 ->expects(static::once()) 67 ->expects(static::once())
68 ->method('addOrSet') 68 ->method('addOrSet')
69 ->willReturnCallback(function (Bookmark $bookmark, bool $save) use ($checkBookmark, $id): void { 69 ->willReturnCallback(function (Bookmark $bookmark, bool $save) use ($checkBookmark, $id): Bookmark {
70 static::assertFalse($save); 70 static::assertFalse($save);
71 71
72 $checkBookmark($bookmark); 72 $checkBookmark($bookmark);
73 73
74 $bookmark->setId($id); 74 $bookmark->setId($id);
75
76 return $bookmark;
75 }) 77 })
76 ; 78 ;
77 $this->container->bookmarkService 79 $this->container->bookmarkService
78 ->expects(static::once()) 80 ->expects(static::once())
79 ->method('set') 81 ->method('set')
80 ->willReturnCallback(function (Bookmark $bookmark, bool $save) use ($checkBookmark, $id): void { 82 ->willReturnCallback(function (Bookmark $bookmark, bool $save) use ($checkBookmark, $id): Bookmark {
81 static::assertTrue($save); 83 static::assertTrue($save);
82 84
83 $checkBookmark($bookmark); 85 $checkBookmark($bookmark);
84 86
85 static::assertSame($id, $bookmark->getId()); 87 static::assertSame($id, $bookmark->getId());
88
89 return $bookmark;
86 }) 90 })
87 ; 91 ;
88 92
@@ -155,21 +159,25 @@ class SaveBookmarkTest extends TestCase
155 $this->container->bookmarkService 159 $this->container->bookmarkService
156 ->expects(static::once()) 160 ->expects(static::once())
157 ->method('addOrSet') 161 ->method('addOrSet')
158 ->willReturnCallback(function (Bookmark $bookmark, bool $save) use ($checkBookmark, $id): void { 162 ->willReturnCallback(function (Bookmark $bookmark, bool $save) use ($checkBookmark, $id): Bookmark {
159 static::assertFalse($save); 163 static::assertFalse($save);
160 164
161 $checkBookmark($bookmark); 165 $checkBookmark($bookmark);
166
167 return $bookmark;
162 }) 168 })
163 ; 169 ;
164 $this->container->bookmarkService 170 $this->container->bookmarkService
165 ->expects(static::once()) 171 ->expects(static::once())
166 ->method('set') 172 ->method('set')
167 ->willReturnCallback(function (Bookmark $bookmark, bool $save) use ($checkBookmark, $id): void { 173 ->willReturnCallback(function (Bookmark $bookmark, bool $save) use ($checkBookmark, $id): Bookmark {
168 static::assertTrue($save); 174 static::assertTrue($save);
169 175
170 $checkBookmark($bookmark); 176 $checkBookmark($bookmark);
171 177
172 static::assertSame($id, $bookmark->getId()); 178 static::assertSame($id, $bookmark->getId());
179
180 return $bookmark;
173 }) 181 })
174 ; 182 ;
175 183
@@ -230,8 +238,10 @@ class SaveBookmarkTest extends TestCase
230 $this->container->bookmarkService 238 $this->container->bookmarkService
231 ->expects(static::once()) 239 ->expects(static::once())
232 ->method('addOrSet') 240 ->method('addOrSet')
233 ->willReturnCallback(function (Bookmark $bookmark, bool $save) use ($thumb): void { 241 ->willReturnCallback(function (Bookmark $bookmark, bool $save) use ($thumb): Bookmark {
234 static::assertSame($thumb, $bookmark->getThumbnail()); 242 static::assertSame($thumb, $bookmark->getThumbnail());
243
244 return $bookmark;
235 }) 245 })
236 ; 246 ;
237 247