From 8c494de1f02e11965183cb319b4fe6a1c053cac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 19 May 2025 17:51:22 +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 This uses the new tests/autoload.php from nextcloud/server instead of messing directly with OC private autoloader. Signed-off-by: Côme Chilliet --- tests/bootstrap.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 301798cecf..2f296cd4f4 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,26 +1,28 @@ addValidRoot(OC::$SERVERROOT . '/tests'); - -// Fix for "Autoload path not allowed: .../photos/tests/testcase.php" -\OC_App::loadApp('photos'); +require_once __DIR__ . '/../../../tests/autoload.php'; if (!class_exists(TestCase::class)) { require_once('PHPUnit/Autoload.php'); } +Server::get(IAppManager::class)->loadApp('photos'); + OC_Hook::clear(); From f36f22063006288859b96d6ce6285422a97660fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 19 May 2025 17:52:44 +0200 Subject: [PATCH 2/2] fix(tests): Hooks should not be cleared unless really necessary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- tests/bootstrap.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 2f296cd4f4..f335cab1e7 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -24,5 +24,3 @@ } Server::get(IAppManager::class)->loadApp('photos'); - -OC_Hook::clear();