mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 13:03:50 +00:00
Add attachments to workflow
This commit is contained in:
@@ -11,6 +11,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Service\GenericDoc\Providers;
|
||||
|
||||
use Chill\CalendarBundle\Repository\CalendarDocRepositoryInterface;
|
||||
use Chill\CalendarBundle\Security\Voter\CalendarVoter;
|
||||
use Chill\CalendarBundle\Service\GenericDoc\Providers\AccompanyingPeriodCalendarGenericDocProvider;
|
||||
use Chill\DocStoreBundle\GenericDoc\FetchQueryToSqlBuilder;
|
||||
@@ -35,11 +36,14 @@ class AccompanyingPeriodCalendarGenericDocProviderTest extends KernelTestCase
|
||||
|
||||
private EntityManagerInterface $entityManager;
|
||||
|
||||
private CalendarDocRepositoryInterface $calendarDocRepository;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$this->security = self::getContainer()->get(Security::class);
|
||||
$this->entityManager = self::getContainer()->get(EntityManagerInterface::class);
|
||||
$this->calendarDocRepository = self::getContainer()->get(CalendarDocRepositoryInterface::class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,7 +51,7 @@ class AccompanyingPeriodCalendarGenericDocProviderTest extends KernelTestCase
|
||||
*/
|
||||
public function testBuildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate, ?string $content): void
|
||||
{
|
||||
$provider = new AccompanyingPeriodCalendarGenericDocProvider($this->security, $this->entityManager);
|
||||
$provider = new AccompanyingPeriodCalendarGenericDocProvider($this->security, $this->entityManager, $this->calendarDocRepository);
|
||||
|
||||
$query = $provider->buildFetchQueryForAccompanyingPeriod($accompanyingPeriod, $startDate, $endDate, $content);
|
||||
|
||||
@@ -66,7 +70,7 @@ class AccompanyingPeriodCalendarGenericDocProviderTest extends KernelTestCase
|
||||
$security = $this->prophesize(Security::class);
|
||||
$security->isGranted(CalendarVoter::SEE, Argument::any())->willReturn(true);
|
||||
|
||||
$provider = new AccompanyingPeriodCalendarGenericDocProvider($security->reveal(), $this->entityManager);
|
||||
$provider = new AccompanyingPeriodCalendarGenericDocProvider($security->reveal(), $this->entityManager, $this->calendarDocRepository);
|
||||
|
||||
$query = $provider->buildFetchQueryForPerson($person, $startDate, $endDate, $content);
|
||||
|
||||
@@ -87,7 +91,7 @@ class AccompanyingPeriodCalendarGenericDocProviderTest extends KernelTestCase
|
||||
$security = $this->prophesize(Security::class);
|
||||
$security->isGranted(CalendarVoter::SEE, Argument::any())->willReturn(false);
|
||||
|
||||
$provider = new AccompanyingPeriodCalendarGenericDocProvider($security->reveal(), $this->entityManager);
|
||||
$provider = new AccompanyingPeriodCalendarGenericDocProvider($security->reveal(), $this->entityManager, $this->calendarDocRepository);
|
||||
|
||||
$query = $provider->buildFetchQueryForPerson($person, $startDate, $endDate, $content);
|
||||
|
||||
|
@@ -9,10 +9,11 @@ declare(strict_types=1);
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Service\GenericDoc\Providers;
|
||||
namespace Chill\PersonBundle\Tests\Service\GenericDoc\Providers;
|
||||
|
||||
use Chill\DocStoreBundle\GenericDoc\FetchQueryToSqlBuilder;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocumentRepository;
|
||||
use Chill\PersonBundle\Service\GenericDoc\Providers\AccompanyingPeriodWorkEvaluationGenericDocProvider;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Prophecy\PhpUnit\ProphecyTrait;
|
||||
@@ -29,10 +30,13 @@ class AccompanyingPeriodWorkEvaluationGenericDocProviderTest extends KernelTestC
|
||||
use ProphecyTrait;
|
||||
private EntityManagerInterface $entityManager;
|
||||
|
||||
private AccompanyingPeriodWorkEvaluationDocumentRepository $repository;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$this->entityManager = self::getContainer()->get(EntityManagerInterface::class);
|
||||
$this->repository = self::getContainer()->get(AccompanyingPeriodWorkEvaluationDocumentRepository::class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,7 +59,8 @@ class AccompanyingPeriodWorkEvaluationGenericDocProviderTest extends KernelTestC
|
||||
|
||||
$provider = new AccompanyingPeriodWorkEvaluationGenericDocProvider(
|
||||
$security->reveal(),
|
||||
$this->entityManager
|
||||
$this->entityManager,
|
||||
$this->repository,
|
||||
);
|
||||
|
||||
$query = $provider->buildFetchQueryForAccompanyingPeriod($period, $startDate, $endDate, $content);
|
||||
|
Reference in New Issue
Block a user