Set a date restriction.
public withDateRestriction ( string $dateFieldName, string $operation, DateTime $date ) | ||
$dateFieldName | string | |
$operation | string | |
$date | DateTime |
/** * @test */ public function it_can_handle_multiple_date_restrictions() { $dateFieldName = 'myDate'; $operation = '>'; $date = new DateTime(); $otherDateFieldName = 'otherDate'; $otherOperation = '<'; $otherDate = new DateTime(); $this->query->withDateRestriction($dateFieldName, $operation, $date); $this->query->withDateRestriction($otherDateFieldName, $otherOperation, $otherDate); $this->assertEquals($this->expectedResult(['numericFilters' => ",{$dateFieldName}{$operation}{$date->getTimestamp()},{$otherDateFieldName}{$otherOperation}{$otherDate->getTimestamp()}"]), $this->query->toArray()); }