Skip to content

Commit

Permalink
test: set timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
sitepark-veltrup committed May 13, 2024
1 parent d8e484d commit 0543849
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions test/Service/Indexer/IndexerStatusStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,17 @@ private function createIndexerStatus(): IndexerStatus
{

$startTime = new \DateTime();
$startTime->setTimezone(new \DateTimeZone('UTC'));
$startTime->setDate(2024, 1, 31);
$startTime->setTime(11, 15, 10);

$endTime = new \DateTime();
$endTime->setTimezone(new \DateTimeZone('UTC'));
$endTime->setDate(2024, 1, 31);
$endTime->setTime(12, 16, 11);

$lastUpdate = new \DateTime();
$lastUpdate->setTimezone(new \DateTimeZone('UTC'));
$lastUpdate->setDate(2024, 1, 31);
$lastUpdate->setTime(13, 17, 12);

Expand Down
14 changes: 7 additions & 7 deletions test/Service/Search/SolrQueryFilterAppenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ public function testQueryFilter(): void

public function testAbsoluteDateRangeFilterWithFromAndTo(): void
{
$from = new \DateTime('2021-01-01 00:00:00');
$to = new \DateTime('2021-01-02 00:00:00');
$from = new \DateTime('2021-01-01 00:00:00Z');
$to = new \DateTime('2021-01-02 00:00:00Z');
$filter = new AbsoluteDateRangeFilter($from, $to, 'sp_date_list');

$this->filterQuery->expects($this->once())
Expand All @@ -145,7 +145,7 @@ public function testAbsoluteDateRangeFilterWithFromAndTo(): void

public function testAbsoluteDateRangeFilterWithFrom(): void
{
$from = new \DateTime('2021-01-01 00:00:00');
$from = new \DateTime('2021-01-01 00:00:00Z');
$filter = new AbsoluteDateRangeFilter($from, null, 'sp_date_list');

$this->filterQuery->expects($this->once())
Expand All @@ -157,7 +157,7 @@ public function testAbsoluteDateRangeFilterWithFrom(): void

public function testAbsoluteDateRangeFilterWithTo(): void
{
$to = new \DateTime('2021-01-02 00:00:00');
$to = new \DateTime('2021-01-02 00:00:00Z');
$filter = new AbsoluteDateRangeFilter(null, $to, 'sp_date_list');

$this->filterQuery->expects($this->once())
Expand Down Expand Up @@ -219,21 +219,21 @@ public static function additionProviderWithBase(): array
{
return [
[
new DateTime('2021-01-01 00:00:00'),
new DateTime('2021-01-01 00:00:00Z'),
'P1D',
null,
'test:[2021-01-01T00:00:00Z-1DAYS/DAY' .
' TO 2021-01-01T00:00:00Z/DAY+1DAY-1SECOND]'
],
[
new DateTime('2021-01-01 00:00:00'),
new DateTime('2021-01-01 00:00:00Z'),
null,
'P2M',
'test:[2021-01-01T00:00:00Z/DAY' .
' TO 2021-01-01T00:00:00Z+2MONTHS/DAY+1DAY-1SECOND]'
],
[
new DateTime('2021-01-01 00:00:00'),
new DateTime('2021-01-01 00:00:00Z'),
'P1W',
'P2M',
'test:[2021-01-01T00:00:00Z-7DAYS/DAY' .
Expand Down

0 comments on commit 0543849

Please sign in to comment.