]> BookStack Code Mirror - bookstack/blobdiff - tests/Entity/EntitySearchTest.php
Page Attachments - Improved UI, Now initially complete
[bookstack] / tests / Entity / EntitySearchTest.php
index a9d9bc04775c89f4b6ba3161c6bf09fd51c0ccea..8adfd35a3e3c59037c2cb8e8e1f7574bf46adc66 100644 (file)
@@ -76,6 +76,14 @@ class EntitySearchTest extends TestCase
             ->see('Chapter Search Results')->seeInElement('.entity-list', $chapter->name);
     }
 
+    public function test_search_quote_term_preparation()
+    {
+        $termString = '"192" cat "dog hat"';
+        $repo = $this->app[\BookStack\Repos\EntityRepo::class];
+        $preparedTerms = $repo->prepareSearchTerms($termString);
+        $this->assertTrue($preparedTerms === ['"192"','"dog hat"', 'cat']);
+    }
+
     public function test_books_search_listing()
     {
         $book = \BookStack\Book::all()->last();