From 750818397fbd41c085c7ad270f712b894cfc47bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 20 May 2025 10:31:52 +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 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/unit/bootstrap.php b/tests/unit/bootstrap.php index fbffdc376..b9fcd6cb1 100644 --- a/tests/unit/bootstrap.php +++ b/tests/unit/bootstrap.php @@ -1,17 +1,27 @@ addValidRoot(\OC::$SERVERROOT . '/tests'); -\OC_App::loadApp('user_saml'); -if (!class_exists(\PHPUnit\Framework\TestCase::class)) { +require_once __DIR__ . '/../../../../tests/autoload.php'; + +Server::get(IAppManager::class)->loadApp('user_saml'); + +if (!class_exists(TestCase::class)) { require_once('PHPUnit/Autoload.php'); } + OC_Hook::clear(); From 6826aaca7d7c9efcc3e60b9658db446af8536a60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 20 May 2025 10:32:05 +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 b9fcd6cb1..ba7de6df6 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();