-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] Fix the sorting in the daily registration digest (#23)
- Loading branch information
1 parent
a91b77a
commit 416bb00
Showing
5 changed files
with
48 additions
and
35 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
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 |
---|---|---|
|
@@ -15,7 +15,6 @@ | |
/** | ||
* Test case. | ||
* | ||
* | ||
* @author Niels Pardon <[email protected]> | ||
* @author Oliver Klee <[email protected]> | ||
*/ | ||
|
@@ -1077,33 +1076,6 @@ public function findForAutomaticStatusChangeNotFindsPlannedEventWithoutAutomatic | |
self::assertTrue($result->isEmpty()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function findForAutomaticStatusChangeSortsResultsByStartDateInAscendingOrder() | ||
{ | ||
$laterUid = $this->testingFramework->createRecord( | ||
'tx_seminars_seminars', | ||
[ | ||
'begin_date' => mktime(10, 0, 0, 1, 20, 2018), | ||
'cancelled' => Tx_Seminars_Model_Event::STATUS_PLANNED, | ||
'automatic_confirmation_cancelation' => 1 | ||
] | ||
); | ||
$earlierUid = $this->testingFramework->createRecord( | ||
'tx_seminars_seminars', | ||
[ | ||
'begin_date' => mktime(10, 0, 0, 1, 15, 2018), | ||
'cancelled' => Tx_Seminars_Model_Event::STATUS_PLANNED, | ||
'automatic_confirmation_cancelation' => 1 | ||
] | ||
); | ||
|
||
$result = $this->fixture->findForAutomaticStatusChange(); | ||
|
||
self::assertSame($earlierUid . ',' . $laterUid, $result->getUids()); | ||
} | ||
|
||
/* | ||
* Tests concerning findForRegistrationDigestEmail | ||
*/ | ||
|
@@ -1162,6 +1134,44 @@ public function findForRegistrationDigestEmailFindsEventWithRegistrationAndWitho | |
self::assertSame($eventUid, $result->first()->getUid()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function findForRegistrationDigestEmailSortsEventsByBeginDateInAscendingOrder() | ||
{ | ||
$laterEventUid = $this->testingFramework->createRecord( | ||
'tx_seminars_seminars', | ||
[ | ||
'object_type' => Tx_Seminars_Model_Event::TYPE_COMPLETE, | ||
'begin_date' => mktime(10, 0, 0, 1, 20, 2018), | ||
'date_of_last_registration_digest' => 0, | ||
'registrations' => 1, | ||
] | ||
); | ||
$this->testingFramework->createRecord( | ||
'tx_seminars_attendances', | ||
['seminar' => $laterEventUid, 'crdate' => 1] | ||
); | ||
$earlierEventUid = $this->testingFramework->createRecord( | ||
'tx_seminars_seminars', | ||
[ | ||
'object_type' => Tx_Seminars_Model_Event::TYPE_COMPLETE, | ||
'begin_date' => mktime(10, 0, 0, 1, 15, 2018), | ||
'date_of_last_registration_digest' => 0, | ||
'registrations' => 1, | ||
] | ||
); | ||
$this->testingFramework->createRecord( | ||
'tx_seminars_attendances', | ||
['seminar' => $earlierEventUid, 'crdate' => 1] | ||
); | ||
|
||
$result = $this->fixture->findForRegistrationDigestEmail(); | ||
|
||
self::assertSame(2, $result->count()); | ||
self::assertSame($earlierEventUid . ',' . $laterEventUid, $result->getUids()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
|
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