@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use App\Services\Ai\HybridFusion;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class AiHybridFusionTest extends TestCase
|
||||
{
|
||||
public function test_fusion_excludes_unauthorised_ids_and_does_not_double_count_duplicates(): void
|
||||
{
|
||||
$fusion = new HybridFusion;
|
||||
$ranking = $fusion->rank(['secret', 'a', 'a', 'b'], ['b', 'secret'], ['a', 'b']);
|
||||
$this->assertSame(['b', 'a'], array_column($ranking, 'id'));
|
||||
$this->assertEqualsWithDelta(1 / 62, $ranking[1]['score'], 0.000001);
|
||||
$this->assertSame([], $fusion->rank(['a'], ['b'], []));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user