From be9a3b078cd5b00688d32e459e6104f450770ee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 20 May 2025 10:16:15 +0200 Subject: [PATCH 1/2] chore(tests): Cleanup bootstrap.php to be forward-compatible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- tests/unit/bootstrap.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/unit/bootstrap.php b/tests/unit/bootstrap.php index 4ff11d2ee..e8df4e124 100644 --- a/tests/unit/bootstrap.php +++ b/tests/unit/bootstrap.php @@ -1,19 +1,27 @@ addValidRoot(\OC::$SERVERROOT . '/tests'); -\OC_App::loadApp('tables'); -if (!class_exists('\PHPUnit\Framework\TestCase')) { +Server::get(IAppManager::class)->loadApp('tables'); + +if (!class_exists(TestCase::class)) { require_once('PHPUnit/Autoload.php'); } + OC_Hook::clear(); From 854dd427bcb1152b02f9ec71fce8472d6e4cb5c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 20 May 2025 10:16:27 +0200 Subject: [PATCH 2/2] chore(tests): Do not clear hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- tests/unit/bootstrap.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/unit/bootstrap.php b/tests/unit/bootstrap.php index e8df4e124..ee1d0ef4c 100644 --- a/tests/unit/bootstrap.php +++ b/tests/unit/bootstrap.php @@ -23,5 +23,3 @@ if (!class_exists(TestCase::class)) { require_once('PHPUnit/Autoload.php'); } - -OC_Hook::clear();