3, 'total_relation' => TotalRelation::Exact->value, 'total_is_exact' => true, 'items' => [], ]; $results['beta'] = [ 'total' => 10000, 'total_relation' => TotalRelation::AtLeast->value, 'total_is_exact' => false, 'items' => [], ]; return $results; }, 5); // When: 통합 검색을 호출 $response = $this->getJson('/api/search?q=테스트'); // Then: 카테고리별 정확도가 각각 실린다 $response->assertOk(); $response->assertJsonPath('data.counts_are_exact.alpha', true); $response->assertJsonPath('data.counts_are_exact.beta', false); } /** * 정확도를 싣지 않은 카테고리는 정확한 것으로 보되 키는 존재하는지 확인 * * 키 자체가 없으면 화면이 "정확도 정보 없음" 과 "정확함" 을 구분하지 못한다. * * @effects badge_accuracy_defaults_to_exact */ public function test_category_without_accuracy_defaults_to_exact(): void { // Given: 정확도를 싣지 않은 카테고리 HookManager::addFilter('core.search.results', function (array $results): array { $results['legacy'] = ['total' => 7, 'items' => []]; return $results; }, 5); // When: 통합 검색을 호출 $response = $this->getJson('/api/search?q=테스트'); // Then: 키는 존재하고 값은 정확으로 해석된다 $response->assertOk(); $response->assertJsonPath('data.counts_are_exact.legacy', true); } }