diff options
author | skjnldsv <skjnldsv@protonmail.com> | 2024-08-01 22:28:08 +0200 |
---|---|---|
committer | skjnldsv <skjnldsv@protonmail.com> | 2024-08-06 16:25:10 +0200 |
commit | db28aa8cd14d40a671396778a06af10879b5d14a (patch) | |
tree | 1e0715112704d643e46076de1528e4375634cd80 /tests/lib/AppFramework | |
parent | 69f01b1df6bf12657b7ddcf8c42ef3cf00c3ea84 (diff) | |
download | nextcloud-server-db28aa8cd14d40a671396778a06af10879b5d14a.tar.gz nextcloud-server-db28aa8cd14d40a671396778a06af10879b5d14a.zip |
fix(files_sharing): show proper share not found error message
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Diffstat (limited to 'tests/lib/AppFramework')
-rw-r--r-- | tests/lib/AppFramework/Middleware/PublicShare/PublicShareMiddlewareTest.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/lib/AppFramework/Middleware/PublicShare/PublicShareMiddlewareTest.php b/tests/lib/AppFramework/Middleware/PublicShare/PublicShareMiddlewareTest.php index 03cd253044d..64a9efbfe60 100644 --- a/tests/lib/AppFramework/Middleware/PublicShare/PublicShareMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/PublicShare/PublicShareMiddlewareTest.php @@ -10,8 +10,9 @@ use OC\AppFramework\Middleware\PublicShare\Exceptions\NeedAuthenticationExceptio use OC\AppFramework\Middleware\PublicShare\PublicShareMiddleware; use OCP\AppFramework\AuthPublicShareController; use OCP\AppFramework\Controller; -use OCP\AppFramework\Http\NotFoundResponse; +use OCP\AppFramework\Http; use OCP\AppFramework\Http\RedirectResponse; +use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\PublicShareController; use OCP\Files\NotFoundException; use OCP\IConfig; @@ -236,7 +237,8 @@ class PublicShareMiddlewareTest extends \Test\TestCase { $exception = new NotFoundException(); $result = $this->middleware->afterException($controller, 'method', $exception); - $this->assertInstanceOf(NotFoundResponse::class, $result); + $this->assertInstanceOf(TemplateResponse::class, $result); + $this->assertEquals($result->getStatus(), Http::STATUS_NOT_FOUND); } public function testAfterExceptionPublicShareController() { |