From a656427aec9b9454d14100481644744032bd2fc0 Mon Sep 17 00:00:00 2001 From: bach Date: Tue, 17 Nov 2026 12:57:42 +0100 Subject: [PATCH] materio_sapi: RankFusionTest as a Drupal UnitTestCase with PHPUnit attributes (T1) Runs with vendor/bin/phpunit -c web/core: 6 tests, 8 assertions. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ShDspHaZGwHoRZCsPBJzsM --- .../materio_sapi/tests/src/Unit/RankFusionTest.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/web/modules/custom/materio_sapi/tests/src/Unit/RankFusionTest.php b/web/modules/custom/materio_sapi/tests/src/Unit/RankFusionTest.php index 7cdf523f..0ffd5b7f 100644 --- a/web/modules/custom/materio_sapi/tests/src/Unit/RankFusionTest.php +++ b/web/modules/custom/materio_sapi/tests/src/Unit/RankFusionTest.php @@ -5,18 +5,16 @@ declare(strict_types=1); namespace Drupal\Tests\materio_sapi\Unit; use Drupal\materio_sapi\RankFusion; -use PHPUnit\Framework\TestCase; - -// No Drupal bootstrap needed: RankFusion is plain PHP. -require_once __DIR__ . '/../../../src/RankFusion.php'; +use Drupal\Tests\UnitTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; /** * Tests the merge of the keyword and kNN rankings (H5). - * - * @coversDefaultClass \Drupal\materio_sapi\RankFusion - * @group materio_sapi */ -final class RankFusionTest extends TestCase { +#[CoversClass(RankFusion::class)] +#[Group('materio_sapi')] +final class RankFusionTest extends UnitTestCase { /** * Exact matches stay first, in their order, even when ranked low elsewhere.