diff --git a/build/integration/features/bootstrap/RemoteContext.php b/build/integration/features/bootstrap/RemoteContext.php index 38f3ab7648..69ebad4320 100644 --- a/build/integration/features/bootstrap/RemoteContext.php +++ b/build/integration/features/bootstrap/RemoteContext.php @@ -138,7 +138,13 @@ class RemoteContext implements Context { * @param string $value */ public function hasCapability($key, $value) { - $capabilities = $this->getApiClient()->getCapabilities(); + try { + $capabilities = $this->getApiClient()->getCapabilities(); + } catch (\Exception $e) { + Assert::assertInstanceOf($value, $e); + $this->lastException = $e; + return; + } $current = $capabilities; $parts = explode('.', $key); foreach ($parts as $part) { diff --git a/build/integration/remoteapi_features/remote.feature b/build/integration/remoteapi_features/remote.feature index 72daf8226c..62fd95e013 100644 --- a/build/integration/remoteapi_features/remote.feature +++ b/build/integration/remoteapi_features/remote.feature @@ -34,4 +34,5 @@ Feature: remote Given using remote server "REMOTE" And user "user0" exists And using credentials "user0", "invalid" - Then the capability "theming.name" is "Nextcloud" + Then the capability "theming.name" is "OC\ForbiddenException" + Then the request should throw a "OC\ForbiddenException"