From bc591a47a2da38dc0324630a561a7a4d07adf4b0 Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 14 Dec 2024 23:21:41 +0000 Subject: [PATCH] [test] try/catch for defining ShimmiePHPUnitTestCase --- core/testcase.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/testcase.php b/core/testcase.php index f7cff2a0f..373befb31 100644 --- a/core/testcase.php +++ b/core/testcase.php @@ -4,7 +4,7 @@ namespace Shimmie2; -if (class_exists("\\PHPUnit\\Framework\\TestCase")) { +try { abstract class ShimmiePHPUnitTestCase extends \PHPUnit\Framework\TestCase { protected static string $anon_name = "anonymous"; @@ -289,7 +289,9 @@ protected function delete_image(int $image_id): void } } } -} else { +} +// @phpstan-ignore-next-line +catch (\Throwable $e) { abstract class ShimmiePHPUnitTestCase { }