1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Fixed single word quoted search terms

Fixes #170
This commit is contained in:
Dan Brown
2016-08-25 17:17:26 +01:00
parent f2ceba978a
commit f83de5f834
3 changed files with 17 additions and 7 deletions

View 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();