Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/staging' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
acquia-cs-bot committed Oct 10, 2024
2 parents 6a75e4b + 467455c commit d3e3241
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Tests/Functional/Helper/QueryFilterHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,42 @@ public function testGetCustomValueValueExpression(): void
],
(new DateTime('tomorrow'))->format('Y-m-d 23:59:59')
);

$this->assertMatchWhere(
'test_value.value >= :pard',
[
'glue' => 'and',
'field' => 'cmf_'.$this->getFixtureById('custom_object_product')->getId(),
'object' => 'custom_object',
'type' => 'date',
'operator' => 'gte',
'properties' => [
'filter' => [
'dateTypeMode' => 'absolute',
'absoluteDate' => 'yesterday',
],
],
],
(new DateTime('yesterday'))->format('Y-m-d')
);

$this->assertMatchWhere(
'test_value.value <= :pare',
[
'glue' => 'and',
'field' => 'cmf_'.$this->getFixtureById('custom_object_product')->getId(),
'object' => 'custom_object',
'type' => 'datetime',
'operator' => 'lte',
'properties' => [
'filter' => [
'dateTypeMode' => 'absolute',
'absoluteDate' => 'tomorrow',
],
],
],
(new DateTime('tomorrow'))->format('Y-m-d 23:59:59')
);
}

protected function assertMatchWhere(string $expectedWhere, array $filter, ?string $expectedValue = null): void
Expand Down

0 comments on commit d3e3241

Please sign in to comment.