aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/front
diff options
context:
space:
mode:
Diffstat (limited to 'tests/front')
-rw-r--r--tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php b/tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php
index 3999b44e..f7a68226 100644
--- a/tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php
+++ b/tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php
@@ -241,6 +241,30 @@ class SaveBookmarkTest extends TestCase
241 } 241 }
242 242
243 /** 243 /**
244 * Test save a bookmark - with ID #0
245 */
246 public function testSaveBookmarkWithIdZero(): void
247 {
248 $parameters = ['lf_id' => '0'];
249
250 $request = $this->createMock(Request::class);
251 $request
252 ->method('getParam')
253 ->willReturnCallback(function (string $key) use ($parameters): ?string {
254 return $parameters[$key] ?? null;
255 })
256 ;
257 $response = new Response();
258
259 $this->container->bookmarkService->expects(static::once())->method('exists')->with(0)->willReturn(true);
260 $this->container->bookmarkService->expects(static::once())->method('get')->with(0)->willReturn(new Bookmark());
261
262 $result = $this->controller->save($request, $response);
263
264 static::assertSame(302, $result->getStatusCode());
265 }
266
267 /**
244 * Change the password with a wrong existing password 268 * Change the password with a wrong existing password
245 */ 269 */
246 public function testSaveBookmarkFromBookmarklet(): void 270 public function testSaveBookmarkFromBookmarklet(): void