fix phpunit tests errors

This commit is contained in:
Mathieu Jaumotte 2023-10-04 10:06:46 +02:00
parent 15e23087ed
commit b4e5618e00
8 changed files with 15 additions and 15 deletions

View File

@ -12,7 +12,7 @@ declare(strict_types=1);
namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators; namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Aggregator\BySocialActionAggregator; use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\BySocialActionAggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;

View File

@ -12,7 +12,7 @@ declare(strict_types=1);
namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators; namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Aggregator\BySocialIssueAggregator; use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\BySocialIssueAggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;

View File

@ -47,10 +47,10 @@ class CreatorJobAggregator implements AggregatorInterface
$qb->expr()->andX( $qb->expr()->andX(
$qb->expr()->eq("{$p}_userHistory.accompanyingPeriod", "acp.id"), $qb->expr()->eq("{$p}_userHistory.accompanyingPeriod", "acp.id"),
$qb->expr()->andX( $qb->expr()->andX(
$qb->expr()->gte("COALESCE(acp.endDate, CURRENT_TIMESTAMP)", "{$p}_userHistory.startDate"), $qb->expr()->gte("COALESCE(acp.closingDate, CURRENT_TIMESTAMP())", "{$p}_userHistory.startDate"),
$qb->expr()->orX( $qb->expr()->orX(
$qb->expr()->isNull("{$p}_userHistory.endDate"), $qb->expr()->isNull("{$p}_userHistory.endDate"),
$qb->expr()->lt("COALESCE(acp.endDate, CURRENT_TIMESTAMP)", "{$p}_userHistory.endDate") $qb->expr()->lt("COALESCE(acp.closingDate, CURRENT_TIMESTAMP())", "{$p}_userHistory.endDate")
) )
) )
) )

View File

@ -47,10 +47,10 @@ readonly class ReferrerScopeAggregator implements AggregatorInterface
$qb->expr()->andX( $qb->expr()->andX(
$qb->expr()->eq("{$p}_userHistory.accompanyingPeriod", "acp.id"), $qb->expr()->eq("{$p}_userHistory.accompanyingPeriod", "acp.id"),
$qb->expr()->andX( $qb->expr()->andX(
$qb->expr()->gte("COALESCE(acp.endDate, CURRENT_TIMESTAMP)", "{$p}_userHistory.startDate"), $qb->expr()->gte("COALESCE(acp.closingDate, CURRENT_TIMESTAMP())", "{$p}_userHistory.startDate"),
$qb->expr()->orX( $qb->expr()->orX(
$qb->expr()->isNull("{$p}_userHistory.endDate"), $qb->expr()->isNull("{$p}_userHistory.endDate"),
$qb->expr()->lt("COALESCE(acp.endDate, CURRENT_TIMESTAMP)", "{$p}_userHistory.endDate") $qb->expr()->lt("COALESCE(acp.closingDate, CURRENT_TIMESTAMP())", "{$p}_userHistory.endDate")
) )
) )
) )
@ -70,7 +70,7 @@ readonly class ReferrerScopeAggregator implements AggregatorInterface
) )
) )
) )
->addSelect("IDENTITY({$p}_sh.scope) AS {$p}_select") ->addSelect("IDENTITY({$p}_scopeHistory.scope) AS {$p}_select")
->addGroupBy("{$p}_select"); ->addGroupBy("{$p}_select");
} }

View File

@ -46,10 +46,10 @@ final readonly class UserJobAggregator implements AggregatorInterface
$qb->expr()->andX( $qb->expr()->andX(
$qb->expr()->eq("{$p}_userHistory.accompanyingPeriod", "acp.id"), $qb->expr()->eq("{$p}_userHistory.accompanyingPeriod", "acp.id"),
$qb->expr()->andX( $qb->expr()->andX(
$qb->expr()->gte("COALESCE(acp.endDate, CURRENT_TIMESTAMP)", "{$p}_userHistory.startDate"), $qb->expr()->gte("COALESCE(acp.closingDate, CURRENT_TIMESTAMP())", "{$p}_userHistory.startDate"),
$qb->expr()->orX( $qb->expr()->orX(
$qb->expr()->isNull("{$p}_userHistory.endDate"), $qb->expr()->isNull("{$p}_userHistory.endDate"),
$qb->expr()->lt("COALESCE(acp.endDate, CURRENT_TIMESTAMP)", "{$p}_userHistory.endDate") $qb->expr()->lt("COALESCE(acp.closingDate, CURRENT_TIMESTAMP())", "{$p}_userHistory.endDate")
) )
) )
) )

View File

@ -48,10 +48,10 @@ class CreatorJobFilter implements FilterInterface
$qb->expr()->andX( $qb->expr()->andX(
$qb->expr()->eq("{$p}_userHistory.accompanyingPeriod", "acp.id"), $qb->expr()->eq("{$p}_userHistory.accompanyingPeriod", "acp.id"),
$qb->expr()->andX( $qb->expr()->andX(
$qb->expr()->gte("COALESCE(acp.endDate, CURRENT_TIMESTAMP)", "{$p}_userHistory.startDate"), $qb->expr()->gte("COALESCE(acp.closingDate, CURRENT_TIMESTAMP())", "{$p}_userHistory.startDate"),
$qb->expr()->orX( $qb->expr()->orX(
$qb->expr()->isNull("{$p}_userHistory.endDate"), $qb->expr()->isNull("{$p}_userHistory.endDate"),
$qb->expr()->lt("COALESCE(acp.endDate, CURRENT_TIMESTAMP)", "{$p}_userHistory.endDate") $qb->expr()->lt("COALESCE(acp.closingDate, CURRENT_TIMESTAMP())", "{$p}_userHistory.endDate")
) )
) )
) )

View File

@ -48,10 +48,10 @@ class UserJobFilter implements FilterInterface
$qb->expr()->andX( $qb->expr()->andX(
$qb->expr()->eq("{$p}_userHistory.accompanyingPeriod", "acp.id"), $qb->expr()->eq("{$p}_userHistory.accompanyingPeriod", "acp.id"),
$qb->expr()->andX( $qb->expr()->andX(
$qb->expr()->gte("COALESCE(acp.endDate, CURRENT_TIMESTAMP)", "{$p}_userHistory.startDate"), $qb->expr()->gte("COALESCE(acp.closingDate, CURRENT_TIMESTAMP())", "{$p}_userHistory.startDate"),
$qb->expr()->orX( $qb->expr()->orX(
$qb->expr()->isNull("{$p}_userHistory.endDate"), $qb->expr()->isNull("{$p}_userHistory.endDate"),
$qb->expr()->lt("COALESCE(acp.endDate, CURRENT_TIMESTAMP)", "{$p}_userHistory.endDate") $qb->expr()->lt("COALESCE(acp.closingDate, CURRENT_TIMESTAMP())", "{$p}_userHistory.endDate")
) )
) )
) )

View File

@ -48,10 +48,10 @@ class UserScopeFilter implements FilterInterface
$qb->expr()->andX( $qb->expr()->andX(
$qb->expr()->eq("{$p}_userHistory.accompanyingPeriod", "acp.id"), $qb->expr()->eq("{$p}_userHistory.accompanyingPeriod", "acp.id"),
$qb->expr()->andX( $qb->expr()->andX(
$qb->expr()->gte("COALESCE(acp.endDate, CURRENT_TIMESTAMP)", "{$p}_userHistory.startDate"), $qb->expr()->gte("COALESCE(acp.closingDate, CURRENT_TIMESTAMP())", "{$p}_userHistory.startDate"),
$qb->expr()->orX( $qb->expr()->orX(
$qb->expr()->isNull("{$p}_userHistory.endDate"), $qb->expr()->isNull("{$p}_userHistory.endDate"),
$qb->expr()->lt("COALESCE(acp.endDate, CURRENT_TIMESTAMP)", "{$p}_userHistory.endDate") $qb->expr()->lt("COALESCE(acp.closingDate, CURRENT_TIMESTAMP())", "{$p}_userHistory.endDate")
) )
) )
) )