Skip to content

Commit 66d1766

Browse files
chore: add date filter in searchEvents check
1 parent d077e40 commit 66d1766

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

run_checks.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,12 @@
8484
}
8585

8686
try {
87+
// 2 years from now
88+
$start = (new DateTime())->sub(new DateInterval('P2Y'));
89+
$end = new DateTime();
90+
8791
/** @var SearchEventsResponse $result */
88-
list($result, $response) = $client->searchEvents(10, $visitor_id);
92+
list($result, $response) = $client->searchEvents(10, $visitor_id, null, null, null, $start->getTimestamp() * 1000, $end->getTimestamp() * 1000);
8993
if (is_countable($result->getEvents()) && count($result->getEvents()) > 0 && $result->getEvents()[0]->getProducts()->getIdentification()->getData()->getVisitorId() !== $visitor_id) {
9094
throw new Exception('Argument visitorId is not equal to deserialized getVisitorId');
9195
}

0 commit comments

Comments
 (0)