Skip to content

Commit 07ec880

Browse files
committed
Testing: Updated search tests to consider new limits
1 parent ab436ed commit 07ec880

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/Search/SearchOptionsTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,14 @@ public function test_from_string_parses_negations()
3535

3636
public function test_from_string_properly_parses_escaped_quotes()
3737
{
38-
$options = SearchOptions::fromString('"\"cat\"" surprise "\"\"" "\"donkey" "\"" "\\\\"');
38+
$options = SearchOptions::fromString('"\"cat\"" surprise');
39+
$this->assertEquals(['"cat"'], $options->exacts->toValueArray());
3940

40-
$this->assertEquals(['"cat"', '""', '"donkey', '"', '\\'], $options->exacts->toValueArray());
41+
$options = SearchOptions::fromString('"\"\"" "\"donkey"');
42+
$this->assertEquals(['""', '"donkey'], $options->exacts->toValueArray());
43+
44+
$options = SearchOptions::fromString('"\"" "\\\\"');
45+
$this->assertEquals(['"', '\\'], $options->exacts->toValueArray());
4146
}
4247

4348
public function test_to_string_includes_all_items_in_the_correct_format()
@@ -104,6 +109,7 @@ public function test_it_cannot_parse_out_empty_exacts()
104109

105110
public function test_from_request_properly_parses_exacts_from_search_terms()
106111
{
112+
$this->asEditor();
107113
$request = new Request([
108114
'search' => 'biscuits "cheese" "" "baked beans"'
109115
]);

0 commit comments

Comments
 (0)