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); }