Refactor filters and aggregators of "acpwusers" for using the acpw referrer history instead

This commit is contained in:
2023-10-16 13:06:25 +02:00
parent 51a4ffca2e
commit b65f76262a
10 changed files with 101 additions and 117 deletions

View File

@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Tests\Export\Aggregator\SocialWorkAggregators;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
use Chill\PersonBundle\Export\Aggregator\SocialWorkAggregators\ReferrerAggregator;
@@ -39,7 +40,10 @@ final class ReferrerAggregatorTest extends AbstractAggregatorTest
public function getFormData(): array
{
return [
[],
[], // there are previous saved export which does not contains any data
[
'referrer_at' => new RollingDate(RollingDate::T_TODAY)
]
];
}

View File

@@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Tests\Export\Filter\SocialWorkFilters;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Test\Export\AbstractFilterTest;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Export\Filter\SocialWorkFilters\ReferrerFilter;
@@ -47,8 +48,13 @@ final class ReferrerFilterTest extends AbstractFilterTest
$data = [];
foreach ($users as $u) {
$data[] = [
'accepted_agents' => $u, // some saved export does not have the parameter "agent_at"
];
$data[] = [
'accepted_agents' => $u,
'agent_at' => new RollingDate(RollingDate::T_TODAY)
];
}