1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

Added auto-conversion of search terms to exact values

Will occur when a search term contains a character that's used to split
content into search terms.
Added testing to cover.
This commit is contained in:
Dan Brown
2021-11-12 18:03:44 +00:00
parent 99587a0be6
commit 7d0724e288
3 changed files with 59 additions and 8 deletions

View File

@ -119,6 +119,18 @@ class EntitySearchTest extends TestCase
$exactSearchB->assertStatus(200)->assertDontSee($page->name);
}
public function test_search_terms_with_delimiters_are_converted_to_exact_matches()
{
$this->asEditor();
$page = $this->newPage(['name' => 'Delimiter test', 'html' => '<p>1.1 2,2 3?3 4:4 5;5 (8) &lt;9&gt; "10" \'11\' `12`</p>']);
$terms = explode(' ', '1.1 2,2 3?3 4:4 5;5 (8) <9> "10" \'11\' `12`');
foreach ($terms as $term) {
$search = $this->get('/search?term=' . urlencode($term));
$search->assertSee($page->name);
}
}
public function test_search_filters()
{
$page = $this->newPage(['name' => 'My new test quaffleachits', 'html' => 'this is about an orange donkey danzorbhsing']);