diff --git a/tests/lib/SetupTest.php b/tests/lib/SetupTest.php index 3def0ff69e1b3..9fc49b5b361ac 100644 --- a/tests/lib/SetupTest.php +++ b/tests/lib/SetupTest.php @@ -149,10 +149,11 @@ public function testFindWebRootCli($url, $expected): void { $webRoot = self::invokePrivate($this->setupClass, 'findWebRoot', [$this->config]); } catch (\InvalidArgumentException $e) { $webRoot = false; + } finally { + \OC::$CLI = $cliState; } - \OC::$CLI = $cliState; - $this->assertSame($webRoot, $expected); + $this->assertSame($expected, $webRoot); } public static function findWebRootProvider(): array {