From 4f42780929666f6b8a93309bfd84e4667a018a31 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Sun, 1 Dec 2019 21:53:08 +0545 Subject: [PATCH] Fixup StoragesServiceTest expectException --- tests/lib/Files/External/Service/StoragesServiceTest.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/lib/Files/External/Service/StoragesServiceTest.php b/tests/lib/Files/External/Service/StoragesServiceTest.php index 06796ae0c1ad..2d17eeea2c0a 100644 --- a/tests/lib/Files/External/Service/StoragesServiceTest.php +++ b/tests/lib/Files/External/Service/StoragesServiceTest.php @@ -235,7 +235,9 @@ protected function makeStorageConfig($data) { /** */ public function testNonExistingStorage() { - $this->expectException(\OCP\Files\External\NotFoundException::class); + if ($this->getExpectedException() === null) { + $this->expectException(\OCP\Files\External\NotFoundException::class); + } $backend = $this->backendService->getBackend('identifier:\OCA\Files_External\Lib\Backend\SMB'); $authMechanism = $this->backendService->getAuthMechanism('identifier:\Auth\Mechanism'); @@ -320,7 +322,9 @@ public function testDeleteStorage($backendOptions, $rustyStorageId, $expectedCou /** */ public function testDeleteUnexistingStorage() { - $this->expectException(\OCP\Files\External\NotFoundException::class); + if ($this->getExpectedException() === null) { + $this->expectException(\OCP\Files\External\NotFoundException::class); + } $this->service->removeStorage(255); }