mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-22 08:56:42 -06:00
Fix VisitIterationRepositoryTest for MS SQL
This commit is contained in:
parent
f0e62004d5
commit
82e7094f3a
@ -51,12 +51,12 @@ class VisitIterationRepository extends EntitySpecificationRepository implements
|
||||
{
|
||||
$qb = $this->createQueryBuilder('v');
|
||||
if ($dateRange?->startDate !== null) {
|
||||
$qb->andWhere($qb->expr()->gte('v.date', ':since'));
|
||||
$qb->setParameter('since', $dateRange->startDate, ChronosDateTimeType::CHRONOS_DATETIME);
|
||||
$qb->andWhere($qb->expr()->gte('v.date', ':since'))
|
||||
->setParameter('since', $dateRange->startDate, ChronosDateTimeType::CHRONOS_DATETIME);
|
||||
}
|
||||
if ($dateRange?->endDate !== null) {
|
||||
$qb->andWhere($qb->expr()->lte('v.date', ':until'));
|
||||
$qb->setParameter('until', $dateRange->endDate, ChronosDateTimeType::CHRONOS_DATETIME);
|
||||
$qb->andWhere($qb->expr()->lte('v.date', ':until'))
|
||||
->setParameter('until', $dateRange->endDate, ChronosDateTimeType::CHRONOS_DATETIME);
|
||||
}
|
||||
|
||||
return $this->visitsIterableForQuery($qb, $blockSize);
|
||||
|
@ -55,17 +55,17 @@ class VisitIterationRepositoryTest extends DatabaseTestCase
|
||||
$unlocated = $this->repo->findUnlocatedVisits($blockSize);
|
||||
$all = $this->repo->findAllVisits(blockSize: $blockSize);
|
||||
$lastThreeDays = $this->repo->findAllVisits(
|
||||
dateRange: DateRange::since(Chronos::now()->subDays(2)),
|
||||
dateRange: DateRange::since(Chronos::now()->subDays(2)->startOfDay()),
|
||||
blockSize: $blockSize,
|
||||
);
|
||||
$firstTwoDays = $this->repo->findAllVisits(
|
||||
dateRange: DateRange::until(Chronos::now()->subDays(4)),
|
||||
dateRange: DateRange::until(Chronos::now()->subDays(4)->endOfDay()),
|
||||
blockSize: $blockSize,
|
||||
);
|
||||
$daysInBetween = $this->repo->findAllVisits(
|
||||
dateRange: DateRange::between(
|
||||
startDate: Chronos::now()->subDays(5),
|
||||
endDate: Chronos::now()->subDays(2),
|
||||
startDate: Chronos::now()->subDays(5)->startOfDay(),
|
||||
endDate: Chronos::now()->subDays(2)->endOfDay(),
|
||||
),
|
||||
blockSize: $blockSize,
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user