aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/tests
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2024-09-05 20:35:26 +0200
committerLouis <louis@chmn.me>2024-09-09 17:30:19 +0200
commit8524ab9a0937f084ae9ea0ab19aafc0f2fac06ed (patch)
treed6c557f1af746ebf8a913b6cdf39b12f0ad07db9 /apps/dav/tests
parent9dbc7016421873bde22bc13cc784abf85ee644b5 (diff)
downloadnextcloud-server-8524ab9a0937f084ae9ea0ab19aafc0f2fac06ed.tar.gz
nextcloud-server-8524ab9a0937f084ae9ea0ab19aafc0f2fac06ed.zip
fix(dav): Always respond custom error page on exceptions
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps/dav/tests')
-rw-r--r--apps/dav/tests/travis/caldavtest/tests/CalDAV/sync-report.xml2
-rw-r--r--apps/dav/tests/unit/DAV/ErrorPagePluginTest.php (renamed from apps/dav/tests/unit/DAV/BrowserErrorPagePluginTest.php)8
2 files changed, 5 insertions, 5 deletions
diff --git a/apps/dav/tests/travis/caldavtest/tests/CalDAV/sync-report.xml b/apps/dav/tests/travis/caldavtest/tests/CalDAV/sync-report.xml
index cf4fcde251f..388d9df8413 100644
--- a/apps/dav/tests/travis/caldavtest/tests/CalDAV/sync-report.xml
+++ b/apps/dav/tests/travis/caldavtest/tests/CalDAV/sync-report.xml
@@ -2712,7 +2712,7 @@
<callback>prepostcondition</callback>
<arg>
<name>error</name>
- <value>{DAV:}valid-sync-token</value>
+ <value>{http://sabredav.org/ns}exception</value>
</arg>
<arg>
<name>ignoreextras</name>
diff --git a/apps/dav/tests/unit/DAV/BrowserErrorPagePluginTest.php b/apps/dav/tests/unit/DAV/ErrorPagePluginTest.php
index b6ec05afd78..3c87574e8d2 100644
--- a/apps/dav/tests/unit/DAV/BrowserErrorPagePluginTest.php
+++ b/apps/dav/tests/unit/DAV/ErrorPagePluginTest.php
@@ -23,11 +23,11 @@
*/
namespace OCA\DAV\Tests\unit\DAV;
-use OCA\DAV\Files\BrowserErrorPagePlugin;
+use OCA\DAV\Files\ErrorPagePlugin;
use Sabre\DAV\Exception\NotFound;
use Sabre\HTTP\Response;
-class BrowserErrorPagePluginTest extends \Test\TestCase {
+class ErrorPagePluginTest extends \Test\TestCase {
/**
* @dataProvider providesExceptions
@@ -35,8 +35,8 @@ class BrowserErrorPagePluginTest extends \Test\TestCase {
* @param $exception
*/
public function test($expectedCode, $exception): void {
- /** @var BrowserErrorPagePlugin | \PHPUnit\Framework\MockObject\MockObject $plugin */
- $plugin = $this->getMockBuilder(BrowserErrorPagePlugin::class)->setMethods(['sendResponse', 'generateBody'])->getMock();
+ /** @var ErrorPagePlugin | \PHPUnit\Framework\MockObject\MockObject $plugin */
+ $plugin = $this->getMockBuilder(ErrorPagePlugin::class)->disableOriginalConstructor()->setMethods(['sendResponse', 'generateBody'])->getMock();
$plugin->expects($this->once())->method('generateBody')->willReturn(':boom:');
$plugin->expects($this->once())->method('sendResponse');
/** @var \Sabre\DAV\Server | \PHPUnit\Framework\MockObject\MockObject $server */