feat: remove obsolete date range override
This commit is contained in:
@@ -20,21 +20,13 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
*/
|
||||
class ApplicationRepositoryTest extends KernelTestCase
|
||||
{
|
||||
public function testOverlappingQueryUsesInclusiveBoundariesAndEffectiveDates(): void
|
||||
public function testOverlappingQueryUsesInclusiveBoundariesOnTheDestinationDates(): void
|
||||
{
|
||||
$dql = $this->createOverlappingQuery()->getDQL();
|
||||
|
||||
// an assignment overrides the date range of its destination, so both have to be considered
|
||||
$this->assertStringContainsString(
|
||||
'(assignment.dateFrom IS NULL AND destination.dateFrom <= :dateTo)'
|
||||
.' OR (assignment.dateFrom IS NOT NULL AND assignment.dateFrom <= :dateTo)',
|
||||
$dql
|
||||
);
|
||||
$this->assertStringContainsString(
|
||||
'(assignment.dateTo IS NULL AND destination.dateTo >= :dateFrom)'
|
||||
.' OR (assignment.dateTo IS NOT NULL AND assignment.dateTo >= :dateFrom)',
|
||||
$dql
|
||||
);
|
||||
// the assignment period is the date range of its destination
|
||||
$this->assertStringContainsString('destination.dateFrom <= :dateTo', $dql);
|
||||
$this->assertStringContainsString('destination.dateTo >= :dateFrom', $dql);
|
||||
|
||||
// strict comparisons would let assignments that touch on a boundary pass and could never
|
||||
// match a single day assignment at all
|
||||
|
||||
Reference in New Issue
Block a user