diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-11-05 16:14:22 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-11-05 16:14:27 +0100 |
commit | 330ac859fb13a3a15875f185a611bfaa6c5f5587 (patch) | |
tree | 9cfb35eeddca847df74019d8f067255dd7cd3aee /tests/front | |
parent | 38b55fbf3d4fdb515d0e82e5a3126d4671652b3e (diff) | |
download | Shaarli-330ac859fb13a3a15875f185a611bfaa6c5f5587.tar.gz Shaarli-330ac859fb13a3a15875f185a611bfaa6c5f5587.tar.zst Shaarli-330ac859fb13a3a15875f185a611bfaa6c5f5587.zip |
Fix: redirect to referrer after bookmark deletion
Except if the referer points to a permalink (which has been deleted).
Fixes #1622
Diffstat (limited to 'tests/front')
-rw-r--r-- | tests/front/controller/admin/ShaareManageControllerTest/DeleteBookmarkTest.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/front/controller/admin/ShaareManageControllerTest/DeleteBookmarkTest.php b/tests/front/controller/admin/ShaareManageControllerTest/DeleteBookmarkTest.php index 770a16d7..a276d988 100644 --- a/tests/front/controller/admin/ShaareManageControllerTest/DeleteBookmarkTest.php +++ b/tests/front/controller/admin/ShaareManageControllerTest/DeleteBookmarkTest.php | |||
@@ -38,6 +38,8 @@ class DeleteBookmarkTest extends TestCase | |||
38 | { | 38 | { |
39 | $parameters = ['id' => '123']; | 39 | $parameters = ['id' => '123']; |
40 | 40 | ||
41 | $this->container->environment['HTTP_REFERER'] = 'http://shaarli/subfolder/shaare/abcdef'; | ||
42 | |||
41 | $request = $this->createMock(Request::class); | 43 | $request = $this->createMock(Request::class); |
42 | $request | 44 | $request |
43 | ->method('getParam') | 45 | ->method('getParam') |
@@ -90,6 +92,8 @@ class DeleteBookmarkTest extends TestCase | |||
90 | { | 92 | { |
91 | $parameters = ['id' => '123 456 789']; | 93 | $parameters = ['id' => '123 456 789']; |
92 | 94 | ||
95 | $this->container->environment['HTTP_REFERER'] = 'http://shaarli/subfolder/?searchtags=abcdef'; | ||
96 | |||
93 | $request = $this->createMock(Request::class); | 97 | $request = $this->createMock(Request::class); |
94 | $request | 98 | $request |
95 | ->method('getParam') | 99 | ->method('getParam') |
@@ -152,7 +156,7 @@ class DeleteBookmarkTest extends TestCase | |||
152 | $result = $this->controller->deleteBookmark($request, $response); | 156 | $result = $this->controller->deleteBookmark($request, $response); |
153 | 157 | ||
154 | static::assertSame(302, $result->getStatusCode()); | 158 | static::assertSame(302, $result->getStatusCode()); |
155 | static::assertSame(['/subfolder/'], $result->getHeader('location')); | 159 | static::assertSame(['/subfolder/?searchtags=abcdef'], $result->getHeader('location')); |
156 | } | 160 | } |
157 | 161 | ||
158 | /** | 162 | /** |