+ $expected = 'cat "dog" [tag=good] {is_tree} {beans:valid}';
+ $options = new SearchOptions();
+ $options->searches = SearchOptionSet::fromValueArray(['cat'], TermSearchOption::class);
+ $options->exacts = SearchOptionSet::fromValueArray(['dog'], ExactSearchOption::class);
+ $options->tags = SearchOptionSet::fromValueArray(['tag=good'], TagSearchOption::class);
+ $options->filters = new SearchOptionSet([
+ new FilterSearchOption('', 'is_tree'),
+ new FilterSearchOption('valid', 'beans'),
+ ]);
+
+ $output = $options->toString();
+ foreach (explode(' ', $expected) as $term) {
+ $this->assertStringContainsString($term, $output);
+ }
+ }
+
+ public function test_to_string_handles_negations_as_expected()
+ {
+ $expected = 'cat -"dog" -[tag=good] -{is_tree}';