diff options
author | Louis Chemineau <louis@chmn.me> | 2024-09-05 16:17:32 +0200 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2024-09-05 16:17:32 +0200 |
commit | 9992e7d4395a773fec7148cf5b4111f894cb40b7 (patch) | |
tree | c6ef4fa92dd64bba0c5525e85cdfcefb14bc5a13 /apps/dav/tests/unit | |
parent | 332b3efdf0df6bd489d83f58e8ffa677749d0774 (diff) | |
download | nextcloud-server-9992e7d4395a773fec7148cf5b4111f894cb40b7.tar.gz nextcloud-server-9992e7d4395a773fec7148cf5b4111f894cb40b7.zip |
fix(dav): Always respond custom error page on exceptions
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps/dav/tests/unit')
-rw-r--r-- | apps/dav/tests/unit/DAV/ErrorPagePluginTest.php (renamed from apps/dav/tests/unit/DAV/BrowserErrorPagePluginTest.php) | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/dav/tests/unit/DAV/BrowserErrorPagePluginTest.php b/apps/dav/tests/unit/DAV/ErrorPagePluginTest.php index 088330cecff..a3569f34bd7 100644 --- a/apps/dav/tests/unit/DAV/BrowserErrorPagePluginTest.php +++ b/apps/dav/tests/unit/DAV/ErrorPagePluginTest.php @@ -7,11 +7,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 @@ -19,8 +19,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 */ |