mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -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');
|
$qb = $this->createQueryBuilder('v');
|
||||||
if ($dateRange?->startDate !== null) {
|
if ($dateRange?->startDate !== null) {
|
||||||
$qb->andWhere($qb->expr()->gte('v.date', ':since'));
|
$qb->andWhere($qb->expr()->gte('v.date', ':since'))
|
||||||
$qb->setParameter('since', $dateRange->startDate, ChronosDateTimeType::CHRONOS_DATETIME);
|
->setParameter('since', $dateRange->startDate, ChronosDateTimeType::CHRONOS_DATETIME);
|
||||||
}
|
}
|
||||||
if ($dateRange?->endDate !== null) {
|
if ($dateRange?->endDate !== null) {
|
||||||
$qb->andWhere($qb->expr()->lte('v.date', ':until'));
|
$qb->andWhere($qb->expr()->lte('v.date', ':until'))
|
||||||
$qb->setParameter('until', $dateRange->endDate, ChronosDateTimeType::CHRONOS_DATETIME);
|
->setParameter('until', $dateRange->endDate, ChronosDateTimeType::CHRONOS_DATETIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->visitsIterableForQuery($qb, $blockSize);
|
return $this->visitsIterableForQuery($qb, $blockSize);
|
||||||
|
@ -55,17 +55,17 @@ class VisitIterationRepositoryTest extends DatabaseTestCase
|
|||||||
$unlocated = $this->repo->findUnlocatedVisits($blockSize);
|
$unlocated = $this->repo->findUnlocatedVisits($blockSize);
|
||||||
$all = $this->repo->findAllVisits(blockSize: $blockSize);
|
$all = $this->repo->findAllVisits(blockSize: $blockSize);
|
||||||
$lastThreeDays = $this->repo->findAllVisits(
|
$lastThreeDays = $this->repo->findAllVisits(
|
||||||
dateRange: DateRange::since(Chronos::now()->subDays(2)),
|
dateRange: DateRange::since(Chronos::now()->subDays(2)->startOfDay()),
|
||||||
blockSize: $blockSize,
|
blockSize: $blockSize,
|
||||||
);
|
);
|
||||||
$firstTwoDays = $this->repo->findAllVisits(
|
$firstTwoDays = $this->repo->findAllVisits(
|
||||||
dateRange: DateRange::until(Chronos::now()->subDays(4)),
|
dateRange: DateRange::until(Chronos::now()->subDays(4)->endOfDay()),
|
||||||
blockSize: $blockSize,
|
blockSize: $blockSize,
|
||||||
);
|
);
|
||||||
$daysInBetween = $this->repo->findAllVisits(
|
$daysInBetween = $this->repo->findAllVisits(
|
||||||
dateRange: DateRange::between(
|
dateRange: DateRange::between(
|
||||||
startDate: Chronos::now()->subDays(5),
|
startDate: Chronos::now()->subDays(5)->startOfDay(),
|
||||||
endDate: Chronos::now()->subDays(2),
|
endDate: Chronos::now()->subDays(2)->endOfDay(),
|
||||||
),
|
),
|
||||||
blockSize: $blockSize,
|
blockSize: $blockSize,
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user