Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] Fixed calendar display issue for events on DST days
Refs #1219
- Loading branch information
Showing
3 changed files
with
80 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
"tx_sfeventmgt_domain_model_event" | ||
,"pid","startdate","enddate","title","description","link","rowDescription" | ||
,4,1730019600 ,1730026800,Test 27.10.2024 10:00 - 12:00,Test,link,27.10.2024 10:00 - 12:00 | ||
,4,1729990800,1729991400,Test 27.10.2024 02:00 - 2:10,Test,link,27.10.2024 - 02:00 - 02:10 | ||
,4,1711846800,1711850400,Test 31.03.2024 - 3:00 - 4:00,Test,link,31.03.2024 - 3:00 - 4:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Extension "sf_event_mgt" for TYPO3 CMS. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
*/ | ||
|
||
namespace DERHANSEN\SfEventMgt\Tests\Functional\Service; | ||
|
||
use DERHANSEN\SfEventMgt\Domain\Model\Dto\EventDemand; | ||
use DERHANSEN\SfEventMgt\Domain\Repository\EventRepository; | ||
use DERHANSEN\SfEventMgt\Service\CalendarService; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; | ||
|
||
class CalendarServiceTest extends FunctionalTestCase | ||
{ | ||
protected EventRepository $eventRepository; | ||
protected array $testExtensionsToLoad = ['typo3conf/ext/sf_event_mgt']; | ||
|
||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->importCSVDataSet(__DIR__ . '/../Fixtures/events_calendarservice.csv'); | ||
|
||
$this->eventRepository = $this->getContainer()->get(EventRepository::class); | ||
} | ||
|
||
|
||
/** | ||
* Test, if events for the 27.10.2024 (date with timeshift) will be returned in the array | ||
* | ||
* @test | ||
*/ | ||
public function getCalendarArrayReturnsArrayWithExpectedEventOnADayWithTimeshiftOctober(): void | ||
{ | ||
$demand = new EventDemand(); | ||
$demand->setStoragePage('4'); | ||
$events = $this->eventRepository->findDemanded($demand); | ||
|
||
$calendarService = GeneralUtility::makeInstance(CalendarService::class); | ||
$calendarArray = $calendarService->getCalendarArray(10, 2024, mktime(0, 0, 0, 10, 27, 2024), 1, $events); | ||
self::assertCount(2, $calendarArray[43][6]['events']); | ||
} | ||
|
||
/** | ||
* Test, if events for the 31.03.2024 (date with timeshift) will be returned in the array | ||
* | ||
* @test | ||
*/ | ||
public function getCalendarArrayReturnsArrayWithExpectedEventOnADayWithTimeshiftMarch(): void | ||
{ | ||
$demand = new EventDemand(); | ||
$demand->setStoragePage('4'); | ||
$events = $this->eventRepository->findDemanded($demand); | ||
|
||
$calendarService = GeneralUtility::makeInstance(CalendarService::class); | ||
$calendarArray = $calendarService->getCalendarArray(3, 2024, mktime(0, 0, 0, 3, 31, 2024), 1, $events); | ||
self::assertCount(1, $calendarArray[13][6]['events']); | ||
} | ||
} |