mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-03 21:34:59 +00:00
[export] create a parameter that will force to skip the filtering by center (ACL) when generating an export
This commit is contained in:
@@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\ActivityBundle\Tests\Export\Export\LinkedToACP;
|
||||
|
||||
use Chill\ActivityBundle\Export\Export\LinkedToACP\AvgActivityDuration;
|
||||
use Chill\ActivityBundle\Repository\ActivityRepository;
|
||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
|
||||
/**
|
||||
@@ -21,18 +22,17 @@ use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
*/
|
||||
final class AvgActivityDurationTest extends AbstractExportTest
|
||||
{
|
||||
private AvgActivityDuration $export;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->export = self::$container->get('chill.activity.export.avg_activity_duration_linked_to_acp');
|
||||
}
|
||||
|
||||
public function getExport()
|
||||
{
|
||||
return $this->export;
|
||||
$activityRepository = self::$container->get(ActivityRepository::class);
|
||||
|
||||
yield new AvgActivityDuration($activityRepository, $this->getParameters(true));
|
||||
yield new AvgActivityDuration($activityRepository, $this->getParameters(false));
|
||||
}
|
||||
|
||||
public function getFormData(): array
|
||||
|
@@ -13,6 +13,7 @@ namespace Chill\ActivityBundle\Tests\Export\Export\LinkedToACP;
|
||||
|
||||
use Chill\ActivityBundle\Export\Export\LinkedToACP\AvgActivityVisitDuration;
|
||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@@ -21,18 +22,17 @@ use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
*/
|
||||
final class AvgActivityVisitDurationTest extends AbstractExportTest
|
||||
{
|
||||
private AvgActivityVisitDuration $export;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->export = self::$container->get('chill.activity.export.avg_activity_visit_duration_linked_to_acp');
|
||||
}
|
||||
|
||||
public function getExport()
|
||||
{
|
||||
return $this->export;
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
|
||||
yield new AvgActivityVisitDuration($em, $this->getParameters(true));
|
||||
yield new AvgActivityVisitDuration($em, $this->getParameters(false));
|
||||
}
|
||||
|
||||
public function getFormData(): array
|
||||
|
@@ -13,6 +13,7 @@ namespace Chill\ActivityBundle\Tests\Export\Export\LinkedToACP;
|
||||
|
||||
use Chill\ActivityBundle\Export\Export\LinkedToACP\CountActivity;
|
||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@@ -21,18 +22,17 @@ use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
*/
|
||||
final class CountActivityTest extends AbstractExportTest
|
||||
{
|
||||
private CountActivity $export;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->export = self::$container->get('chill.activity.export.count_activity_linked_to_acp');
|
||||
}
|
||||
|
||||
public function getExport()
|
||||
{
|
||||
return $this->export;
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
|
||||
yield new CountActivity($em, $this->getParameters(true));
|
||||
yield new CountActivity($em, $this->getParameters(false));
|
||||
}
|
||||
|
||||
public function getFormData(): array
|
||||
|
@@ -13,6 +13,7 @@ namespace Chill\ActivityBundle\Tests\Export\Export\LinkedToACP;
|
||||
|
||||
use Chill\ActivityBundle\Export\Export\LinkedToACP\SumActivityDuration;
|
||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@@ -21,18 +22,17 @@ use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
*/
|
||||
final class SumActivityDurationTest extends AbstractExportTest
|
||||
{
|
||||
private SumActivityDuration $export;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->export = self::$container->get('chill.activity.export.sum_activity_duration_linked_to_acp');
|
||||
}
|
||||
|
||||
public function getExport()
|
||||
{
|
||||
return $this->export;
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
|
||||
yield new SumActivityDuration($em, $this->getParameters(true));
|
||||
yield new SumActivityDuration($em, $this->getParameters(false));
|
||||
}
|
||||
|
||||
public function getFormData(): array
|
||||
|
@@ -13,6 +13,7 @@ namespace Chill\ActivityBundle\Tests\Export\Export\LinkedToACP;
|
||||
|
||||
use Chill\ActivityBundle\Export\Export\LinkedToACP\SumActivityVisitDuration;
|
||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@@ -32,7 +33,10 @@ final class SumActivityVisitDurationTest extends AbstractExportTest
|
||||
|
||||
public function getExport()
|
||||
{
|
||||
return $this->export;
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
|
||||
yield new SumActivityVisitDuration($em, $this->getParameters(true));
|
||||
yield new SumActivityVisitDuration($em, $this->getParameters(false));
|
||||
}
|
||||
|
||||
public function getFormData(): array
|
||||
|
@@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\ActivityBundle\Tests\Export\Export\LinkedToPerson;
|
||||
|
||||
use Chill\ActivityBundle\Export\Export\LinkedToPerson\CountActivity;
|
||||
use Chill\ActivityBundle\Repository\ActivityRepository;
|
||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
|
||||
/**
|
||||
@@ -21,18 +22,17 @@ use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
*/
|
||||
final class CountActivityTest extends AbstractExportTest
|
||||
{
|
||||
private CountActivity $export;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->export = self::$container->get('chill.activity.export.count_activity_linked_to_person');
|
||||
}
|
||||
|
||||
public function getExport()
|
||||
{
|
||||
return $this->export;
|
||||
$activityRepository = self::$container->get(ActivityRepository::class);
|
||||
|
||||
yield new CountActivity($activityRepository, $this->getParameters(true));
|
||||
yield new CountActivity($activityRepository, $this->getParameters(false));
|
||||
}
|
||||
|
||||
public function getFormData(): array
|
||||
|
@@ -12,8 +12,12 @@ declare(strict_types=1);
|
||||
namespace Chill\ActivityBundle\Tests\Export\Export\LinkedToPerson;
|
||||
|
||||
use Chill\ActivityBundle\Export\Export\LinkedToPerson\ListActivity;
|
||||
use Chill\ActivityBundle\Repository\ActivityRepository;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Prophecy\PhpUnit\ProphecyTrait;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@@ -24,14 +28,12 @@ final class ListActivityTest extends AbstractExportTest
|
||||
{
|
||||
use ProphecyTrait;
|
||||
|
||||
private ListActivity $export;
|
||||
private readonly ListActivity $export;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->export = self::$container->get('chill.activity.export.list_activity_linked_to_person');
|
||||
|
||||
$request = $this->prophesize()
|
||||
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
||||
|
||||
@@ -43,7 +45,26 @@ final class ListActivityTest extends AbstractExportTest
|
||||
|
||||
public function getExport()
|
||||
{
|
||||
return $this->export;
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$translator = self::$container->get(TranslatorInterface::class);
|
||||
$translatableStringHelper = self::$container->get(TranslatableStringHelperInterface::class);
|
||||
$activityRepository = self::$container->get(ActivityRepository::class);
|
||||
|
||||
yield new ListActivity(
|
||||
$em,
|
||||
$translator,
|
||||
$translatableStringHelper,
|
||||
$activityRepository,
|
||||
$this->getParameters(true)
|
||||
);
|
||||
|
||||
yield new ListActivity(
|
||||
$em,
|
||||
$translator,
|
||||
$translatableStringHelper,
|
||||
$activityRepository,
|
||||
$this->getParameters(false)
|
||||
);
|
||||
}
|
||||
|
||||
public function getFormData()
|
||||
|
@@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\ActivityBundle\Tests\Export\Export\LinkedToPerson;
|
||||
|
||||
use Chill\ActivityBundle\Export\Export\LinkedToPerson\StatActivityDuration;
|
||||
use Chill\ActivityBundle\Repository\ActivityRepository;
|
||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
|
||||
/**
|
||||
@@ -23,18 +24,18 @@ use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
*/
|
||||
final class StatActivityDurationTest extends AbstractExportTest
|
||||
{
|
||||
private StatActivityDuration $export;
|
||||
private readonly StatActivityDuration $export;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->export = self::$container->get('chill.activity.export.sum_activity_duration_linked_to_person');
|
||||
}
|
||||
|
||||
public function getExport()
|
||||
{
|
||||
return $this->export;
|
||||
$activityRepository = self::$container->get(ActivityRepository::class);
|
||||
yield new StatActivityDuration($activityRepository, $this->getParameters(true), 'sum');
|
||||
yield new StatActivityDuration($activityRepository, $this->getParameters(false), 'sum');
|
||||
}
|
||||
|
||||
public function getFormData(): array
|
||||
|
Reference in New Issue
Block a user