[export] add a filter and aggregator on activity: by creator job

This commit is contained in:
2023-10-16 10:58:00 +02:00
parent 21524f052e
commit 63e9d1a96f
5 changed files with 174 additions and 1 deletions

View File

@@ -0,0 +1,60 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Tests\Export\Aggregator;
use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Aggregator\CreatorScopeAggregator;
use Chill\ActivityBundle\Export\Aggregator\JobScopeAggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface;
/**
* @internal
* @coversNothing
*/
final class JobScopeAggregatorTest extends AbstractAggregatorTest
{
private JobScopeAggregator $aggregator;
protected function setUp(): void
{
self::bootKernel();
$this->aggregator = self::$container->get(JobScopeAggregator::class);
}
public function getAggregator()
{
return $this->aggregator;
}
public function getFormData(): array
{
return [
[],
];
}
public function getQueryBuilders(): array
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()
->select('count(activity.id)')
->from(Activity::class, 'activity')
->leftJoin('activity.accompanyingPeriod', 'acp')
->leftJoin('activity.user', 'actuser'),
];
}
}