mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-31 15:24:31 +03:00
Searching: Fixed some form search issues
- Form was not retaining certain filters - Form request handling of entity type set wrong filter name Added test to cover.
This commit is contained in:
@ -113,6 +113,19 @@ class SearchOptionsTest extends TestCase
|
||||
$this->assertEquals(['"cheese"', '""', '"baked', 'beans"'], $options->exacts->toValueArray());
|
||||
}
|
||||
|
||||
public function test_from_request_properly_parses_provided_types()
|
||||
{
|
||||
$request = new Request([
|
||||
'search' => '',
|
||||
'types' => ['page', 'book'],
|
||||
]);
|
||||
|
||||
$options = SearchOptions::fromRequest($request);
|
||||
$filters = $options->filters->toValueMap();
|
||||
$this->assertCount(1, $filters);
|
||||
$this->assertEquals('page|book', $filters['type'] ?? 'notfound');
|
||||
}
|
||||
|
||||
public function test_from_request_properly_parses_out_extras_as_string()
|
||||
{
|
||||
$request = new Request([
|
||||
|
Reference in New Issue
Block a user