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

Added inIndex method to SearchBuilder #29

Merged
merged 1 commit into from
Oct 13, 2016
Merged

Added inIndex method to SearchBuilder #29

merged 1 commit into from
Oct 13, 2016

Conversation

tobias-kuendig
Copy link
Contributor

This PR enables the user to optionally query a different index than is specified as default in the config file.

Copy link
Owner

@sleimanx2 sleimanx2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something like this for the test ?

$builder = $this->getBuilder();
$connection = $builder->getConnection();
$builder->inIndex('test');
$this->assertEquals($connection->index,'test')


$connection->shouldReceive('setIndex')
->with('test')
->set('index', 'test')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since connection is a mock we'll have to use mockery's set method to set the value of the index property. This way we can make the assertion, but it isn't really testing the connection class, is it?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true

@sleimanx2 sleimanx2 merged commit a2a982f into sleimanx2:master Oct 13, 2016
@tobias-kuendig tobias-kuendig deleted the feature/search-in-index branch October 13, 2016 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants