Skip to content

Commit

Permalink
v3.1.7
Browse files Browse the repository at this point in the history
* Core:
  - Fixes `Orchestra\Support\Traits\QueryFilterTrait::setupWildcardQueryFilter()` to group where clause when generating queries.

Signed-off-by: crynobone <[email protected]>
  • Loading branch information
crynobone committed Nov 25, 2015
1 parent 7ea1cea commit bd2d445
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ title: Support Change Log

## Version 3.1 {#v3-1}

### v3.1.7 {#v3-1-7}

* Core:
- Fixes `Orchestra\Support\Traits\QueryFilterTrait::setupWildcardQueryFilter()` to group where clause when generating queries.

### v3.1.6 {#v3-1-6}

* Core:
Expand Down
2 changes: 1 addition & 1 deletion src/Support/Traits/QueryFilterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ protected function buildWildcardQueryFilters($query, array $fields, array $keywo
}

/**
* Build wildcard query filter by keyword,.
* Build wildcard query filter by keyword.
*
* @param \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder $query
* @param string $field
Expand Down
6 changes: 5 additions & 1 deletion tests/Traits/QueryFilterTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ public function testSetupWildcardQueryFilterMethod()
{
$query = m::mock('\Illuminate\Database\Query\Builder');

$query->shouldReceive('orWhere')->once()->with(m::type('Closure'))
$query->shouldReceive('where')->once()->with(m::type('Closure'))
->andReturnUsing(function ($c) use ($query) {
$c($query);
})
->shouldReceive('orWhere')->once()->with(m::type('Closure'))
->andReturnUsing(function ($c) use ($query) {
$c($query);
})
Expand Down

0 comments on commit bd2d445

Please sign in to comment.