From f1b8e857bf68eb83ecc2db40da53f5d4626a16de Mon Sep 17 00:00:00 2001
From: Dan Brown <ssddanbrown@googlemail.com>
Date: Fri, 14 Feb 2025 19:30:25 +0000
Subject: [PATCH] Searching: Added test for guillemets

To cover #5475
---
 tests/Search/SearchIndexingTest.php | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tests/Search/SearchIndexingTest.php b/tests/Search/SearchIndexingTest.php
index 6933813b6..57cf412e1 100644
--- a/tests/Search/SearchIndexingTest.php
+++ b/tests/Search/SearchIndexingTest.php
@@ -75,6 +75,22 @@ class SearchIndexingTest extends TestCase
         $this->assertEquals(3, $scoreByTerm->get('SuperImportant'));
     }
 
+    public function test_terms_containing_guillemets_handled()
+    {
+        $page = $this->entities->newPage(['html' => '<p>«Hello there» and « there »</p>']);
+
+        $scoreByTerm = $page->searchTerms()->pluck('score', 'term');
+        $expected = ['Hello', 'there', 'and'];
+        foreach ($expected as $term) {
+            $this->assertNotNull($scoreByTerm->get($term), "Failed asserting that \"$term\" is indexed");
+        }
+
+        $nonExpected = ['«', '»'];
+        foreach ($nonExpected as $term) {
+            $this->assertNull($scoreByTerm->get($term), "Failed asserting that \"$term\" is not indexed");
+        }
+    }
+
     public function test_terms_containing_punctuation_within_retain_original_form_and_split_form_in_index()
     {
         $page = $this->entities->newPage(['html' => '<p>super.duper awesome-beans big- barry cheese.</p><p>biscuits</p><p>a-bs</p>']);