mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix tests implementing AbstractAggregatorTest
This commit is contained in:
parent
a197a6b418
commit
37c1dfb0ba
@ -42,6 +42,9 @@
|
|||||||
<testsuite name="WopiBundle">
|
<testsuite name="WopiBundle">
|
||||||
<directory suffix="Test.php">src/Bundle/ChillWopiBundle/tests/</directory>
|
<directory suffix="Test.php">src/Bundle/ChillWopiBundle/tests/</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
|
<testsuite name="ActivityBundle">
|
||||||
|
<directory suffix="Test.php">src/Bundle/ChillActivityBundle/Tests/</directory>
|
||||||
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
|
|
||||||
<listeners>
|
<listeners>
|
||||||
|
@ -45,9 +45,7 @@ final class BySocialActionAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -55,8 +53,8 @@ final class BySocialActionAggregatorTest extends AbstractAggregatorTest
|
|||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(activity.id)')
|
->select('count(activity.id)')
|
||||||
->from(Activity::class, 'activity')
|
->from(Activity::class, 'activity')
|
||||||
->join('activity.accompanyingPeriod', 'acp')
|
->leftJoin('activity.accompanyingPeriod', 'acp')
|
||||||
->join('activity.socialActions', 'actsocialaction'),
|
->leftJoin('activity.socialActions', 'actsocialaction'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,18 +45,16 @@ final class BySocialIssueAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(activity.id)')
|
->select('count(activity)')
|
||||||
->from(Activity::class, 'activity')
|
->from(Activity::class, 'activity')
|
||||||
->join('activity.accompanyingPeriod', 'acp')
|
->leftJoin('activity.accompanyingPeriod', 'acp')
|
||||||
->join('activity.socialIssues', 'actsocialissue'),
|
->leftJoin('activity.socialIssues', 'actsocialissue'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,9 +45,7 @@ final class ByThirdpartyAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -55,8 +53,8 @@ final class ByThirdpartyAggregatorTest extends AbstractAggregatorTest
|
|||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(activity.id)')
|
->select('count(activity.id)')
|
||||||
->from(Activity::class, 'activity')
|
->from(Activity::class, 'activity')
|
||||||
->join('activity.accompanyingPeriod', 'acp')
|
->leftJoin('activity.accompanyingPeriod', 'acp')
|
||||||
->join('activity.thirdParties', 'acttparty'),
|
->leftJoin('activity.thirdParties', 'acttparty'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ final class ByUserAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->aggregator = self::$container->get('chill.activity.export.byuser_aggregator');
|
$this->aggregator = self::$container->get(ByCreatorAggregator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@ -45,9 +45,7 @@ final class ByUserAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -55,8 +53,8 @@ final class ByUserAggregatorTest extends AbstractAggregatorTest
|
|||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(activity.id)')
|
->select('count(activity.id)')
|
||||||
->from(Activity::class, 'activity')
|
->from(Activity::class, 'activity')
|
||||||
->join('activity.accompanyingPeriod', 'acp')
|
->leftJoin('activity.accompanyingPeriod', 'acp')
|
||||||
->join('activity.users', 'actusers'),
|
->leftJoin('activity.users', 'actusers'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,9 +53,7 @@ final class DateAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -63,7 +61,7 @@ final class DateAggregatorTest extends AbstractAggregatorTest
|
|||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(activity.id)')
|
->select('count(activity.id)')
|
||||||
->from(Activity::class, 'activity')
|
->from(Activity::class, 'activity')
|
||||||
->join('activity.accompanyingPeriod', 'acp'),
|
->leftJoin('activity.accompanyingPeriod', 'acp'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,9 +45,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -55,8 +53,8 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(activity.id)')
|
->select('count(activity.id)')
|
||||||
->from(Activity::class, 'activity')
|
->from(Activity::class, 'activity')
|
||||||
->join('activity.accompanyingPeriod', 'acp')
|
->leftJoin('activity.accompanyingPeriod', 'acp')
|
||||||
->join('activity.location', 'actloc'),
|
->leftJoin('activity.location', 'actloc'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ final class UserScopeAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->aggregator = self::$container->get('chill.activity.export.userscope_aggregator');
|
$this->aggregator = self::$container->get(CreatorScopeAggregator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@ -45,9 +45,7 @@ final class UserScopeAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -55,8 +53,8 @@ final class UserScopeAggregatorTest extends AbstractAggregatorTest
|
|||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(activity.id)')
|
->select('count(activity.id)')
|
||||||
->from(Activity::class, 'activity')
|
->from(Activity::class, 'activity')
|
||||||
->join('activity.accompanyingPeriod', 'acp')
|
->leftJoin('activity.accompanyingPeriod', 'acp')
|
||||||
->join('activity.user', 'actuser'),
|
->leftJoin('activity.user', 'actuser'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\ActivityBundle\Tests\Export\Aggregator;
|
namespace Chill\ActivityBundle\Tests\Export\Aggregator;
|
||||||
|
|
||||||
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
|
use Chill\ActivityBundle\Entity\ActivityType;
|
||||||
use Chill\ActivityBundle\Export\Aggregator\ActivityTypeAggregator;
|
use Chill\ActivityBundle\Export\Aggregator\ActivityTypeAggregator;
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
@ -32,7 +34,7 @@ final class ActivityTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->aggregator = self::$container->get('chill.activity.export.type_aggregator');
|
$this->aggregator = self::$container->get(ActivityTypeAggregator::class);
|
||||||
|
|
||||||
$request = $this->prophesize()
|
$request = $this->prophesize()
|
||||||
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
||||||
@ -57,19 +59,17 @@ final class ActivityTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders()
|
public function getQueryBuilders()
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(activity.id)')
|
->select('count(activity.id)')
|
||||||
->from('ChillActivityBundle:Activity', 'activity'),
|
->from(Activity::class, 'activity'),
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(activity.id)')
|
->select('count(activity.id)')
|
||||||
->from('ChillActivityBundle:Activity', 'activity')
|
->from(Activity::class, 'activity')
|
||||||
->join('activity.activityType', 'acttype'),
|
->join('activity.activityType', 'acttype'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\ActivityBundle\Tests\Export\Aggregator;
|
namespace Chill\ActivityBundle\Tests\Export\Aggregator;
|
||||||
|
|
||||||
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\ActivityBundle\Export\Aggregator\ActivityUserAggregator;
|
use Chill\ActivityBundle\Export\Aggregator\ActivityUserAggregator;
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
@ -57,16 +58,14 @@ final class ActivityUserAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(activity.id)')
|
->select('count(activity.id)')
|
||||||
->from('ChillActivityBundle:Activity', 'activity'),
|
->from(Activity::class, 'activity'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\ActivityBundle\Tests\Export\Aggregator\PersonAggregators;
|
namespace Chill\ActivityBundle\Tests\Export\Aggregator\PersonAggregators;
|
||||||
|
|
||||||
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\ActivityBundle\Export\Aggregator\PersonAggregators\ActivityReasonAggregator;
|
use Chill\ActivityBundle\Export\Aggregator\PersonAggregators\ActivityReasonAggregator;
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
@ -30,7 +31,7 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->aggregator = self::$container->get('chill.activity.export.reason_aggregator');
|
$this->aggregator = self::$container->get(ActivityReasonAggregator::class);
|
||||||
|
|
||||||
$request = $this->prophesize()
|
$request = $this->prophesize()
|
||||||
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
||||||
@ -56,23 +57,21 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(activity.id)')
|
->select('count(activity.id)')
|
||||||
->from('ChillActivityBundle:Activity', 'activity'),
|
->from(Activity::class, 'activity'),
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(activity.id)')
|
->select('count(activity.id)')
|
||||||
->from('ChillActivityBundle:Activity', 'activity')
|
->from(Activity::class, 'activity')
|
||||||
->join('activity.reasons', 'actreasons'),
|
->join('activity.reasons', 'actreasons'),
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(activity.id)')
|
->select('count(activity.id)')
|
||||||
->from('ChillActivityBundle:Activity', 'activity')
|
->from(Activity::class, 'activity')
|
||||||
->join('activity.reasons', 'actreasons')
|
->join('activity.reasons', 'actreasons')
|
||||||
->join('actreasons.category', 'actreasoncat'),
|
->join('actreasons.category', 'actreasoncat'),
|
||||||
];
|
];
|
||||||
|
@ -52,9 +52,7 @@ final class AgentAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -62,7 +60,6 @@ final class AgentAggregatorTest extends AbstractAggregatorTest
|
|||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(cal.id)')
|
->select('count(cal.id)')
|
||||||
->from(Calendar::class, 'cal')
|
->from(Calendar::class, 'cal')
|
||||||
->join('cal.mainUser', 'caluser'),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,9 +52,7 @@ final class CancelReasonAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -62,7 +60,6 @@ final class CancelReasonAggregatorTest extends AbstractAggregatorTest
|
|||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(cal.id)')
|
->select('count(cal.id)')
|
||||||
->from(Calendar::class, 'cal')
|
->from(Calendar::class, 'cal')
|
||||||
->join('cal.cancelReason', 'calcancel'),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,9 +52,7 @@ final class JobAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -62,7 +60,6 @@ final class JobAggregatorTest extends AbstractAggregatorTest
|
|||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(cal.id)')
|
->select('count(cal.id)')
|
||||||
->from(Calendar::class, 'cal')
|
->from(Calendar::class, 'cal')
|
||||||
->join('cal.mainUser', 'caluser'),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,9 +52,7 @@ final class LocationAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -62,7 +60,6 @@ final class LocationAggregatorTest extends AbstractAggregatorTest
|
|||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(cal.id)')
|
->select('count(cal.id)')
|
||||||
->from(Calendar::class, 'cal')
|
->from(Calendar::class, 'cal')
|
||||||
->join('cal.location', 'calloc'),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,9 +52,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -62,7 +60,6 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(cal.id)')
|
->select('count(cal.id)')
|
||||||
->from(Calendar::class, 'cal')
|
->from(Calendar::class, 'cal')
|
||||||
->join('cal.location', 'calloc'),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,9 +52,7 @@ final class MonthYearAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -52,9 +52,7 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -62,7 +60,6 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest
|
|||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(cal.id)')
|
->select('count(cal.id)')
|
||||||
->from(Calendar::class, 'cal')
|
->from(Calendar::class, 'cal')
|
||||||
->join('cal.mainUser', 'caluser'),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,6 @@ use function is_string;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper which creates a set of test for aggregators.
|
* Helper which creates a set of test for aggregators.
|
||||||
*
|
|
||||||
* @internal
|
|
||||||
*/
|
*/
|
||||||
abstract class AbstractAggregatorTest extends KernelTestCase
|
abstract class AbstractAggregatorTest extends KernelTestCase
|
||||||
{
|
{
|
||||||
@ -34,9 +32,19 @@ abstract class AbstractAggregatorTest extends KernelTestCase
|
|||||||
*/
|
*/
|
||||||
public function dataProviderAliasDidNotDisappears()
|
public function dataProviderAliasDidNotDisappears()
|
||||||
{
|
{
|
||||||
|
$datas = $this->getFormData();
|
||||||
|
|
||||||
|
if (!is_array($datas)) {
|
||||||
|
$datas = iterator_to_array($datas);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($this->getQueryBuilders() as $qb) {
|
foreach ($this->getQueryBuilders() as $qb) {
|
||||||
foreach ($this->getFormData() as $data) {
|
if ([] === $datas) {
|
||||||
yield [clone $qb, $data];
|
yield [clone $qb, []];
|
||||||
|
} else {
|
||||||
|
foreach ($this->getFormData() as $data) {
|
||||||
|
yield [clone $qb, $data];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -46,9 +54,38 @@ abstract class AbstractAggregatorTest extends KernelTestCase
|
|||||||
*/
|
*/
|
||||||
public function dataProviderAlterQuery()
|
public function dataProviderAlterQuery()
|
||||||
{
|
{
|
||||||
|
$datas = $this->getFormData();
|
||||||
|
|
||||||
|
if (!is_array($datas)) {
|
||||||
|
$datas = iterator_to_array($datas);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($this->getQueryBuilders() as $qb) {
|
foreach ($this->getQueryBuilders() as $qb) {
|
||||||
foreach ($this->getFormData() as $data) {
|
if ([] === $datas) {
|
||||||
yield [clone $qb, $data];
|
yield [clone $qb, []];
|
||||||
|
} else {
|
||||||
|
foreach ($this->getFormData() as $data) {
|
||||||
|
yield [clone $qb, $data];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function dataProviderQueryExecution(): iterable
|
||||||
|
{
|
||||||
|
$datas = $this->getFormData();
|
||||||
|
|
||||||
|
if (!is_array($datas)) {
|
||||||
|
$datas = iterator_to_array($datas);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($this->getQueryBuilders() as $qb) {
|
||||||
|
if ([] === $datas) {
|
||||||
|
yield [clone $qb, []];
|
||||||
|
} else {
|
||||||
|
foreach ($this->getFormData() as $data) {
|
||||||
|
yield [clone $qb, $data];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -58,7 +95,13 @@ abstract class AbstractAggregatorTest extends KernelTestCase
|
|||||||
*/
|
*/
|
||||||
public function dataProviderGetQueryKeys()
|
public function dataProviderGetQueryKeys()
|
||||||
{
|
{
|
||||||
foreach ($this->getFormData() as $data) {
|
$datas = $this->getFormData();
|
||||||
|
|
||||||
|
if (!is_array($datas)) {
|
||||||
|
$datas = iterator_to_array($datas);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($datas as $data) {
|
||||||
yield [$data];
|
yield [$data];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -68,9 +111,19 @@ abstract class AbstractAggregatorTest extends KernelTestCase
|
|||||||
*/
|
*/
|
||||||
public function dataProviderGetResultsAndLabels()
|
public function dataProviderGetResultsAndLabels()
|
||||||
{
|
{
|
||||||
|
$datas = $this->getFormData();
|
||||||
|
|
||||||
|
if (!is_array($datas)) {
|
||||||
|
$datas = iterator_to_array($datas);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($this->getQueryBuilders() as $qb) {
|
foreach ($this->getQueryBuilders() as $qb) {
|
||||||
foreach ($this->getFormData() as $data) {
|
if ([] === $datas) {
|
||||||
yield [clone $qb, $data];
|
yield [clone $qb, []];
|
||||||
|
} else {
|
||||||
|
foreach ($datas as $data) {
|
||||||
|
yield [clone $qb, $data];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -129,6 +182,19 @@ abstract class AbstractAggregatorTest extends KernelTestCase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
* @dataProvider dataProviderQueryExecution
|
||||||
|
*/
|
||||||
|
public function testQueryExecution(QueryBuilder $qb, array $data): void
|
||||||
|
{
|
||||||
|
$this->getAggregator()->alterQuery($qb, $data);
|
||||||
|
|
||||||
|
$actual = $qb->getQuery()->getResult();
|
||||||
|
|
||||||
|
self::assertIsArray($actual);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test the alteration of query by the filter.
|
* test the alteration of query by the filter.
|
||||||
*
|
*
|
||||||
|
@ -45,9 +45,7 @@ final class AdministrativeLocationAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -55,7 +53,6 @@ final class AdministrativeLocationAggregatorTest extends AbstractAggregatorTest
|
|||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(acp.id)')
|
->select('count(acp.id)')
|
||||||
->from(AccompanyingPeriod::class, 'acp')
|
->from(AccompanyingPeriod::class, 'acp')
|
||||||
->join('acp.administrativeLocation', 'acploc'),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,9 +45,7 @@ final class ClosingMotiveAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -55,7 +53,6 @@ final class ClosingMotiveAggregatorTest extends AbstractAggregatorTest
|
|||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(acp.id)')
|
->select('count(acp.id)')
|
||||||
->from(AccompanyingPeriod::class, 'acp')
|
->from(AccompanyingPeriod::class, 'acp')
|
||||||
->join('acp.closingMotive', 'acpmotive'),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,9 +45,7 @@ final class ConfidentialAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -47,9 +47,7 @@ final class DurationAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -45,9 +45,7 @@ final class EmergencyAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -45,9 +45,7 @@ final class EvaluationAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -11,6 +11,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Tests\Export\Aggregator\AccompanyingCourseAggregators;
|
namespace Chill\PersonBundle\Tests\Export\Aggregator\AccompanyingCourseAggregators;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Repository\GeographicalUnitLayerLayerRepository;
|
||||||
|
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators\GeographicalUnitStatAggregator;
|
use Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators\GeographicalUnitStatAggregator;
|
||||||
@ -39,9 +41,12 @@ final class GeographicalUnitStatAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getFormData(): array
|
public function getFormData(): array
|
||||||
{
|
{
|
||||||
// TODO: add geographical unit stat into fixtures and provide a level
|
self::bootKernel();
|
||||||
|
$repository = self::$container->get(GeographicalUnitLayerLayerRepository::class);
|
||||||
|
$levels = $repository->findAll();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
['date_calc' => new DateTimeImmutable('today'), 'level' => null],
|
['date_calc' => new RollingDate(RollingDate::T_TODAY), 'level' => $levels]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,9 +45,7 @@ final class IntensityAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -45,9 +45,7 @@ final class OriginAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Tests\Export\Aggregator\AccompanyingCourseAggregators;
|
namespace Chill\PersonBundle\Tests\Export\Aggregator\AccompanyingCourseAggregators;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators\ReferrerAggregator;
|
use Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators\ReferrerAggregator;
|
||||||
@ -40,15 +41,13 @@ final class ReferrerAggregatorTest extends AbstractAggregatorTest
|
|||||||
public function getFormData(): array
|
public function getFormData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
['date_calc' => new DateTimeImmutable('now')],
|
['date_calc' => new RollingDate(RollingDate::T_TODAY)]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -56,16 +56,14 @@ final class ReferrerScopeAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
'date_calc' => new DateTimeImmutable('now'),
|
'date_calc' => new RollingDate(RollingDate::T_TODAY)
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getQueryBuilders()
|
public function getQueryBuilders()
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -45,9 +45,7 @@ final class RequestorAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -45,9 +45,7 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -56,6 +54,9 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest
|
|||||||
->select('count(acp.id)')
|
->select('count(acp.id)')
|
||||||
->from(AccompanyingPeriod::class, 'acp')
|
->from(AccompanyingPeriod::class, 'acp')
|
||||||
->join('acp.scopes', 'acpscope'),
|
->join('acp.scopes', 'acpscope'),
|
||||||
|
$em->createQueryBuilder()
|
||||||
|
->select('count(acp.id)')
|
||||||
|
->from(AccompanyingPeriod::class, 'acp')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,9 +45,7 @@ final class SocialActionAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -45,9 +45,7 @@ final class SocialIssueAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Tests\Export\Aggregator\AccompanyingCourseAggregators;
|
namespace Chill\PersonBundle\Tests\Export\Aggregator\AccompanyingCourseAggregators;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators\StepAggregator;
|
use Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators\StepAggregator;
|
||||||
@ -41,16 +42,14 @@ final class StepAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
'on_date' => DateTime::createFromFormat('Y-m-d', '2022-01-01'),
|
'on_date' => new RollingDate(RollingDate::T_TODAY)
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -45,9 +45,7 @@ final class UserJobAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -56,6 +54,9 @@ final class UserJobAggregatorTest extends AbstractAggregatorTest
|
|||||||
->select('count(acp.id)')
|
->select('count(acp.id)')
|
||||||
->from(AccompanyingPeriod::class, 'acp')
|
->from(AccompanyingPeriod::class, 'acp')
|
||||||
->join('acp.job', 'acpjob'),
|
->join('acp.job', 'acpjob'),
|
||||||
|
$em->createQueryBuilder()
|
||||||
|
->select('count(acp.id)')
|
||||||
|
->from(AccompanyingPeriod::class, 'acp')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,9 +45,7 @@ final class EvaluationTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Tests\Export\Aggregator\HouseholdAggregators;
|
namespace Chill\PersonBundle\Tests\Export\Aggregator\HouseholdAggregators;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Chill\PersonBundle\Export\Aggregator\HouseholdAggregators\ChildrenNumberAggregator;
|
use Chill\PersonBundle\Export\Aggregator\HouseholdAggregators\ChildrenNumberAggregator;
|
||||||
@ -41,16 +42,14 @@ final class ChildrenNumberAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
'on_date' => DateTime::createFromFormat('Y-m-d', '2022-07-01'),
|
'on_date' => new RollingDate(RollingDate::T_TODAY)
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Tests\Export\Aggregator\HouseholdAggregators;
|
namespace Chill\PersonBundle\Tests\Export\Aggregator\HouseholdAggregators;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Chill\PersonBundle\Export\Aggregator\HouseholdAggregators\CompositionAggregator;
|
use Chill\PersonBundle\Export\Aggregator\HouseholdAggregators\CompositionAggregator;
|
||||||
@ -41,16 +42,14 @@ final class CompositionAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
'on_date' => DateTime::createFromFormat('Y-m-d', '2022-07-01'),
|
'on_date' => new RollingDate(RollingDate::T_TODAY)
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -11,9 +11,12 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Tests\Export\Aggregator\PersonAggregators;
|
namespace Chill\PersonBundle\Tests\Export\Aggregator\PersonAggregators;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Chill\PersonBundle\Export\Aggregator\PersonAggregators\AgeAggregator;
|
use Chill\PersonBundle\Export\Aggregator\PersonAggregators\AgeAggregator;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
@ -39,24 +42,22 @@ final class AgeAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
'date_age_calculation' => DateTime::createFromFormat('Y-m-d', '2016-06-16'),
|
'date_age_calculation' => new RollingDate(RollingDate::T_TODAY)
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getQueryBuilders()
|
public function getQueryBuilders()
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container
|
$em = self::$container
|
||||||
->get('doctrine.orm.entity_manager');
|
->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(person.id)')
|
->select('count(person.id)')
|
||||||
->from('ChillPersonBundle:Person', 'person'),
|
->from(Person::class, 'person'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,9 +46,7 @@ final class CountryOfBirthAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -12,7 +12,9 @@ declare(strict_types=1);
|
|||||||
namespace Chill\PersonBundle\Tests\Export\Aggregator\PersonAggregators;
|
namespace Chill\PersonBundle\Tests\Export\Aggregator\PersonAggregators;
|
||||||
|
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Chill\PersonBundle\Export\Aggregator\PersonAggregators\GenderAggregator;
|
use Chill\PersonBundle\Export\Aggregator\PersonAggregators\GenderAggregator;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
@ -43,17 +45,15 @@ final class GenderAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders()
|
public function getQueryBuilders()
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container
|
$em = self::$container
|
||||||
->get('doctrine.orm.entity_manager');
|
->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(person.id)')
|
->select('count(person.id)')
|
||||||
->from('ChillPersonBundle:Person', 'person'),
|
->from(Person::class, 'person'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Tests\Export\Aggregator\PersonAggregators;
|
namespace Chill\PersonBundle\Tests\Export\Aggregator\PersonAggregators;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
use Chill\PersonBundle\Entity\Household\HouseholdMember;
|
use Chill\PersonBundle\Entity\Household\HouseholdMember;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
@ -43,16 +44,14 @@ final class HouseholdPositionAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
'date_position' => DateTime::createFromFormat('Y-m-d', '2022-07-01'),
|
'date_position' => new RollingDate(RollingDate::T_TODAY)
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -60,8 +59,10 @@ final class HouseholdPositionAggregatorTest extends AbstractAggregatorTest
|
|||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(person.id)')
|
->select('count(person.id)')
|
||||||
->from(Person::class, 'person')
|
->from(Person::class, 'person')
|
||||||
->join(HouseholdMember::class, 'householdmember', Expr\Join::WITH, 'householdmember.person = person')
|
->join(HouseholdMember::class, 'householdmember', Expr\Join::WITH, 'householdmember.person = person'),
|
||||||
->join('person.center', 'center'),
|
$em->createQueryBuilder()
|
||||||
|
->select('count(person.id)')
|
||||||
|
->from(Person::class, 'person')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,9 +45,7 @@ final class MaritalStatusAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -56,6 +54,9 @@ final class MaritalStatusAggregatorTest extends AbstractAggregatorTest
|
|||||||
->select('count(person.id)')
|
->select('count(person.id)')
|
||||||
->from(Person::class, 'person')
|
->from(Person::class, 'person')
|
||||||
->join('person.maritalStatus', 'personmarital'),
|
->join('person.maritalStatus', 'personmarital'),
|
||||||
|
$em->createQueryBuilder()
|
||||||
|
->select('count(person.id)')
|
||||||
|
->from(Person::class, 'person')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,9 @@ declare(strict_types=1);
|
|||||||
namespace Chill\PersonBundle\Tests\Export\Aggregator\PersonAggregators;
|
namespace Chill\PersonBundle\Tests\Export\Aggregator\PersonAggregators;
|
||||||
|
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Chill\PersonBundle\Export\Aggregator\PersonAggregators\NationalityAggregator;
|
use Chill\PersonBundle\Export\Aggregator\PersonAggregators\NationalityAggregator;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
@ -44,17 +46,15 @@ final class NationalityAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders()
|
public function getQueryBuilders()
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container
|
$em = self::$container
|
||||||
->get('doctrine.orm.entity_manager');
|
->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(person.id)')
|
->select('count(person.id)')
|
||||||
->from('ChillPersonBundle:Person', 'person'),
|
->from(Person::class, 'person'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Tests\Export\Aggregator\SocialWorkAggregators;
|
|||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
||||||
use Chill\PersonBundle\Export\Aggregator\SocialWorkAggregators\ActionTypeAggregator;
|
use Chill\PersonBundle\Export\Aggregator\SocialWorkAggregators\ActionTypeAggregator;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
@ -44,12 +45,10 @@ final class ActionTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container
|
$em = self::$container
|
||||||
->get('doctrine.orm.entity_manager');
|
->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
|
@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Tests\Export\Aggregator\SocialWorkAggregators;
|
|||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
||||||
use Chill\PersonBundle\Export\Aggregator\SocialWorkAggregators\GoalAggregator;
|
use Chill\PersonBundle\Export\Aggregator\SocialWorkAggregators\GoalAggregator;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
@ -44,12 +45,10 @@ final class GoalAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container
|
$em = self::$container
|
||||||
->get('doctrine.orm.entity_manager');
|
->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
|
@ -45,9 +45,7 @@ final class GoalResultAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -58,6 +56,11 @@ final class GoalResultAggregatorTest extends AbstractAggregatorTest
|
|||||||
->join('acp.works', 'acpw')
|
->join('acp.works', 'acpw')
|
||||||
->join('acpw.goals', 'goal')
|
->join('acpw.goals', 'goal')
|
||||||
->join('goal.results', 'goalresult'),
|
->join('goal.results', 'goalresult'),
|
||||||
|
$em->createQueryBuilder()
|
||||||
|
->select('count(acp.id)')
|
||||||
|
->from(AccompanyingPeriod::class, 'acp')
|
||||||
|
->join('acp.works', 'acpw')
|
||||||
|
->join('acpw.goals', 'goal')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,9 +45,7 @@ final class JobAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Tests\Export\Aggregator\SocialWorkAggregators;
|
|||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
||||||
use Chill\PersonBundle\Export\Aggregator\SocialWorkAggregators\ReferrerAggregator;
|
use Chill\PersonBundle\Export\Aggregator\SocialWorkAggregators\ReferrerAggregator;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
@ -27,7 +28,7 @@ final class ReferrerAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->aggregator = self::$container->get('chill.person.export.aggregator_referrer');
|
$this->aggregator = self::$container->get(ReferrerAggregator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@ -44,12 +45,10 @@ final class ReferrerAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container
|
$em = self::$container
|
||||||
->get('doctrine.orm.entity_manager');
|
->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
|
@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Tests\Export\Aggregator\SocialWorkAggregators;
|
|||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
||||||
use Chill\PersonBundle\Export\Aggregator\SocialWorkAggregators\ResultAggregator;
|
use Chill\PersonBundle\Export\Aggregator\SocialWorkAggregators\ResultAggregator;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
@ -44,12 +45,10 @@ final class ResultAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container
|
$em = self::$container
|
||||||
->get('doctrine.orm.entity_manager');
|
->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
|
@ -45,9 +45,7 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest
|
|||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
if (null === self::$kernel) {
|
self::bootKernel();
|
||||||
self::bootKernel();
|
|
||||||
}
|
|
||||||
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
@ -82,8 +82,7 @@ services:
|
|||||||
tags:
|
tags:
|
||||||
- { name: chill.export_aggregator, alias: social_work_actions_treatingagent_job_aggregator }
|
- { name: chill.export_aggregator, alias: social_work_actions_treatingagent_job_aggregator }
|
||||||
|
|
||||||
chill.person.export.aggregator_treatingagent:
|
Chill\PersonBundle\Export\Aggregator\SocialWorkAggregators\ReferrerAggregator:
|
||||||
class: Chill\PersonBundle\Export\Aggregator\SocialWorkAggregators\ReferrerAggregator
|
|
||||||
autowire: true
|
autowire: true
|
||||||
autoconfigure: true
|
autoconfigure: true
|
||||||
tags:
|
tags:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user