aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit
diff options
context:
space:
mode:
authorCamila <hello@camilasan.com>2024-02-02 10:41:43 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2024-09-06 17:15:45 +0200
commit0a72756d96cb1d85b6c0fd26189c341b75ec4f0d (patch)
tree5f2c656ec38cf78c40a19ce63491b6cf993c9773 /apps/dav/tests/unit
parenta05e5428c5dea6f1be4dbca8635b729d49c958a6 (diff)
downloadnextcloud-server-0a72756d96cb1d85b6c0fd26189c341b75ec4f0d.tar.gz
nextcloud-server-0a72756d96cb1d85b6c0fd26189c341b75ec4f0d.zip
fix(dav): Update 403 error message
* The user should get a more friendly warning when their desktop client version is not supported anymore by the server. See #nextcloud/desktop/issues/6273 * Update BlockLegacyClientPluginTest to reflect the new 403 error message. Signed-off-by: Camila Ayres <hello@camilasan.com>
Diffstat (limited to 'apps/dav/tests/unit')
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php20
1 files changed, 14 insertions, 6 deletions
diff --git a/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php
index 607ad71b11d..ff928d46a35 100644
--- a/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php
@@ -45,7 +45,20 @@ class BlockLegacyClientPluginTest extends TestCase {
*/
public function testBeforeHandlerException(string $userAgent): void {
$this->expectException(\Sabre\DAV\Exception\Forbidden::class);
- $this->expectExceptionMessage('Unsupported client version.');
+
+ $this->config
+ ->expects($this->once())
+ ->method('getSystemValue')
+ ->with('customclient_desktop', 'https://nextcloud.com/install/#install-clients')
+ ->willReturn('https://nextcloud.com/install/#install-clients');
+
+ $this->config
+ ->expects($this->once())
+ ->method('getSystemValue')
+ ->with('minimum.supported.desktop.version', '2.3.0')
+ ->willReturn('1.7.0');
+
+ $this->expectExceptionMessage('This version of the client is unsupported. Upgrade to <a href="https://nextcloud.com/install/#install-clients">version 1.7.0 or later</a>.');
/** @var RequestInterface|MockObject $request */
$request = $this->createMock('\Sabre\HTTP\RequestInterface');
@@ -55,11 +68,6 @@ class BlockLegacyClientPluginTest extends TestCase {
->with('User-Agent')
->willReturn($userAgent);
- $this->config
- ->expects($this->once())
- ->method('getSystemValue')
- ->with('minimum.supported.desktop.version', '2.3.0')
- ->willReturn('1.7.0');
$this->blockLegacyClientVersionPlugin->beforeHandler($request);
}