more aggregator tests

This commit is contained in:
Julie Lenaerts 2022-08-02 12:31:29 +02:00
parent 40d92d11fc
commit ea12c60154
3 changed files with 174 additions and 0 deletions

View File

@ -0,0 +1,58 @@
<?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;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
/**
* @internal
* @coversNothing
*/
final class ActionTypeAggregatorTest extends AbstractAggregatorTest
{
private ActionTypeAggregator $aggregator;
protected function setUp(): void
{
self::bootKernel();
$this->aggregator = self::$container->get('chill.person.export.aggregator_action_type');
}
public function getAggregator()
{
return $this->aggregator;
}
public function getFormData()
{
return [
[],
];
}
public function getQueryBuilders()
{
if (null === self::$kernel) {
self::bootKernel();
}
$em = self::$container
->get('doctrine.orm.entity_manager');
return [
$em->createQueryBuilder()
->select('count(acpw.id)')
->from('ChillPersonBundle:AccompanyingPeriodWork', 'acpw'),
];
}
}

View File

@ -0,0 +1,58 @@
<?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;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
/**
* @internal
* @coversNothing
*/
final class GoalAggregatorTest extends AbstractAggregatorTest
{
private GoalAggregator $aggregator;
protected function setUp(): void
{
self::bootKernel();
$this->aggregator = self::$container->get('chill.person.export.aggregator_goal');
}
public function getAggregator()
{
return $this->aggregator;
}
public function getFormData()
{
return [
[],
];
}
public function getQueryBuilders()
{
if (null === self::$kernel) {
self::bootKernel();
}
$em = self::$container
->get('doctrine.orm.entity_manager');
return [
$em->createQueryBuilder()
->select('count(acpw.id)')
->from('ChillPersonBundle:AccompanyingPeriodWork', 'acpw'),
];
}
}

View File

@ -0,0 +1,58 @@
<?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;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
/**
* @internal
* @coversNothing
*/
final class ResultAggregatorTest extends AbstractAggregatorTest
{
private ResultAggregator $aggregator;
protected function setUp(): void
{
self::bootKernel();
$this->aggregator = self::$container->get('chill.person.export.aggregator_result');
}
public function getAggregator()
{
return $this->aggregator;
}
public function getFormData()
{
return [
[],
];
}
public function getQueryBuilders()
{
if (null === self::$kernel) {
self::bootKernel();
}
$em = self::$container
->get('doctrine.orm.entity_manager');
return [
$em->createQueryBuilder()
->select('count(acpw.id)')
->from('ChillPersonBundle:AccompanyingPeriodWork', 'acpw'),
];
}
}