]> BookStack Code Mirror - bookstack/blobdiff - tests/Search/SearchIndexingTest.php
ZIP Imports: Added API examples, finished testing
[bookstack] / tests / Search / SearchIndexingTest.php
index 64779dec6327283c42619e9f59fc68263ccf2fc3..d2bbb2905b457bfbb09ee1730e16d6a804ae6186 100644 (file)
@@ -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'));
+    }
 }