Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searching in tests with customized options #899

Open
mrozbarry opened this issue Jan 2, 2025 · 1 comment
Open

Searching in tests with customized options #899

mrozbarry opened this issue Jan 2, 2025 · 1 comment

Comments

@mrozbarry
Copy link

mrozbarry commented Jan 2, 2025

Scout Version

10.11.8

Scout Driver

Typesense

Laravel Version

10.48.25

PHP Version

8.2.0

Database Driver & Version

No response

SDK Version

No response

Meilisearch CLI Version

No response

Description

For tests, we would like to use the collection driver, but we're passing custom options for typesense that (reasonably so) the collection driver doesn't support.

What we would sort of like to see is something like Scout::assertWasSearched(Model::class, [...$options]) so we can abstract the service we're using and really just assert that we at least did the search we expected.

I suspect some of the wisdom for this not being supported would say to just use typesense in searches, but I am curious if what I'm asking for is reasonable and possible, and if so, I'd be more than happy to make a PR.

Steps To Reproduce

Create a test that uses Model::search('')->options(['filter_by' => 'created:[0..9999]']) and see that the collection driver has no concept of the filter_by key that typesense uses.

Copy link

github-actions bot commented Jan 2, 2025

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants