]> BookStack Code Mirror - bookstack/blobdiff - tests/Search/SearchIndexingTest.php
Tests: Updated comment test to account for new editor usage
[bookstack] / tests / Search / SearchIndexingTest.php
index 57cf412e1b713ffec7840395d8d3324e6419b0eb..d2bbb2905b457bfbb09ee1730e16d6a804ae6186 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-namespace Search;
+namespace Tests\Search;
 
 use Tests\TestCase;
 
@@ -106,4 +106,14 @@ class SearchIndexingTest extends TestCase
             $this->assertNull($scoreByTerm->get($term), "Failed asserting that \"$term\" is not indexed");
         }
     }
+
+    public function test_non_breaking_spaces_handled_as_spaces()
+    {
+        $page = $this->entities->newPage(['html' => '<p>a&nbsp;tigerbadger is a dangerous&nbsp;animal</p>']);
+
+        $scoreByTerm = $page->searchTerms()->pluck('score', 'term');
+        $this->assertNotNull($scoreByTerm->get('tigerbadger'));
+        $this->assertNotNull($scoreByTerm->get('dangerous'));
+        $this->assertNotNull($scoreByTerm->get('animal'));
+    }
 }