Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Mar 20, 2024
1 parent 8472f50 commit 0a1c598
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ jobs:
os:
- ubuntu-20.04
php:
- "5.4"
- "5.5"
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
sphinx:
- "2.2.11"
- "3.5.1"
Expand Down
11 changes: 6 additions & 5 deletions tests/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ public function testFacets()

try {
// Sphinx ^3
$query = $query
$results = $query
->select(new Expression('INTERVAL(author_id,200,400,600,800) AS range'))
->facets([
'range' => [
Expand All @@ -495,20 +495,21 @@ public function testFacets()
'authorId' => [
'select' => [new Expression('author_id AS authorId')],
],
]);
])
->search($connection);
} catch (\PDOException $e) {
// Sphinx ^2
$query = $query
$results = $query
->facets([
'range' => [
'select' => 'INTERVAL(author_id,200,400,600,800) AS range',
],
'authorId' => [
'select' => [new Expression('author_id AS authorId')],
],
]);
])
->search($connection);
}
$results = $query->search($connection);
$this->assertNotEmpty($results['hits'], 'Unable to query with facet using custom select');
$this->assertNotEmpty($results['facets']['range'], 'Unable to fill up facet using function in select');
$this->assertNotEmpty($results['facets']['authorId'], 'Unable to fill up facet using `Expression` in select');
Expand Down

0 comments on commit 0a1c598

Please sign in to comment.