exports: create new aggregator test (untested)

This commit is contained in:
Mathieu Jaumotte 2022-09-21 13:27:26 +02:00
parent b13686bbf1
commit 7ef84b9fd0

View File

@ -0,0 +1,57 @@
<?php
/**
* 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.
*/
declare(strict_types=1);
namespace Chill\PersonBundle\Tests\Export\Aggregator\AccompanyingCourseAggregators;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators\GeographicalUnitStatAggregator;
use Doctrine\ORM\EntityManagerInterface;
final class GeographicalUnitStatAggregatorTest extends AbstractAggregatorTest
{
private GeographicalUnitStatAggregator $aggregator;
protected function setUp(): void
{
self::bootKernel();
$this->aggregator = self::$container->get('chill.person.export.aggregator_geographicalunitstat');
}
public function getAggregator()
{
return $this->aggregator;
}
public function getFormData(): array
{
return [
[],
];
}
public function getQueryBuilders(): array
{
if (null === self::$kernel) {
self::bootKernel();
}
$em = self::$container->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()
->select('count(acp.id)')
->from(AccompanyingPeriod::class, 'acp')
,
];
}
}