mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 11:33:49 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -30,6 +30,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
class AccompanyingPeriodContextTest extends KernelTestCase
|
||||
@@ -86,17 +87,17 @@ class AccompanyingPeriodContextTest extends KernelTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* This test run the methods executed when a document is generated:
|
||||
* This test run the methods executed when a document is generated:.
|
||||
*
|
||||
* - normalized data from the form in a way that they are stored in message queue;
|
||||
* - denormalize the data from the message queue,
|
||||
* - and get the data, as they will be transmitted to the GeneratorDriver
|
||||
*
|
||||
* @param array $options the options, as they are stored in the DocGeneratorTemplate (the admin form data)
|
||||
* @param AccompanyingPeriod $entity The entity from which the data will be extracted
|
||||
* @param array $data The data, from the public form
|
||||
* @param array $expectedNormalized, how the normalized data are expected (allow to check that this data will be compliant with the storage in messenger queue)
|
||||
* @param callable $assertionsOnData some test that will be executed on the normalized data
|
||||
* @param array $options the options, as they are stored in the DocGeneratorTemplate (the admin form data)
|
||||
* @param AccompanyingPeriod $entity The entity from which the data will be extracted
|
||||
* @param array $data The data, from the public form
|
||||
* @param callable $assertionsOnData some test that will be executed on the normalized data
|
||||
*
|
||||
* @dataProvider provideNormalizedData
|
||||
*/
|
||||
public function testContextGenerationDataNormalizeDenormalizeGetData(
|
||||
@@ -108,8 +109,8 @@ class AccompanyingPeriodContextTest extends KernelTestCase
|
||||
): void {
|
||||
$context = $this->buildContext();
|
||||
$template = new DocGeneratorTemplate();
|
||||
$template->setName(["fr" => "test"])->setContext(AccompanyingPeriodContext::class)
|
||||
->setDescription("description")->setActive(true)
|
||||
$template->setName(['fr' => 'test'])->setContext(AccompanyingPeriodContext::class)
|
||||
->setDescription('description')->setActive(true)
|
||||
->setOptions($options);
|
||||
|
||||
$normalized = $context->contextGenerationDataNormalize($template, $entity, $data);
|
||||
@@ -128,28 +129,28 @@ class AccompanyingPeriodContextTest extends KernelTestCase
|
||||
self::bootKernel();
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
|
||||
$thirdParty = $em->createQuery("SELECT t FROM " . ThirdParty::class . " t")
|
||||
$thirdParty = $em->createQuery('SELECT t FROM '.ThirdParty::class.' t')
|
||||
->setMaxResults(1)
|
||||
->getSingleResult();
|
||||
|
||||
if (null === $thirdParty) {
|
||||
throw new \RuntimeException("No thirdparty in database");
|
||||
throw new \RuntimeException('No thirdparty in database');
|
||||
}
|
||||
|
||||
$period = $em->createQuery("SELECT a FROM " . AccompanyingPeriod::class . " a WHERE a.step = 'CONFIRMED'")
|
||||
$period = $em->createQuery('SELECT a FROM '.AccompanyingPeriod::class." a WHERE a.step = 'CONFIRMED'")
|
||||
->setMaxResults(1)
|
||||
->getSingleResult();
|
||||
|
||||
if (null === $period) {
|
||||
throw new \RuntimeException("No confirmed period in database");
|
||||
throw new \RuntimeException('No confirmed period in database');
|
||||
}
|
||||
|
||||
$person = $em->createQuery("SELECT p FROM " . Person::class . " p")
|
||||
$person = $em->createQuery('SELECT p FROM '.Person::class.' p')
|
||||
->setMaxResults(1)
|
||||
->getSingleResult();
|
||||
|
||||
if (null === $person) {
|
||||
throw new \RuntimeException("No confirmed period in database");
|
||||
throw new \RuntimeException('No confirmed period in database');
|
||||
}
|
||||
|
||||
yield [
|
||||
@@ -162,11 +163,11 @@ class AccompanyingPeriodContextTest extends KernelTestCase
|
||||
'person2' => false,
|
||||
'person2Label' => 'person2',
|
||||
'thirdParty' => true,
|
||||
'thirdPartyLabel' => '3party'
|
||||
'thirdPartyLabel' => '3party',
|
||||
],
|
||||
$period,
|
||||
[
|
||||
'thirdParty' => $thirdParty
|
||||
'thirdParty' => $thirdParty,
|
||||
],
|
||||
[
|
||||
'thirdParty' => $thirdParty->getId(),
|
||||
@@ -193,7 +194,7 @@ class AccompanyingPeriodContextTest extends KernelTestCase
|
||||
'person2' => false,
|
||||
'person2Label' => 'person2',
|
||||
'thirdParty' => false,
|
||||
'thirdPartyLabel' => '3party'
|
||||
'thirdPartyLabel' => '3party',
|
||||
],
|
||||
$period,
|
||||
[
|
||||
@@ -224,7 +225,7 @@ class AccompanyingPeriodContextTest extends KernelTestCase
|
||||
'person2' => true,
|
||||
'person2Label' => 'person2',
|
||||
'thirdParty' => true,
|
||||
'thirdPartyLabel' => '3party'
|
||||
'thirdPartyLabel' => '3party',
|
||||
],
|
||||
$period,
|
||||
[
|
||||
@@ -267,7 +268,7 @@ class AccompanyingPeriodContextTest extends KernelTestCase
|
||||
'person2' => false,
|
||||
'person2Label' => 'person2',
|
||||
'thirdParty' => false,
|
||||
'thirdPartyLabel' => '3party'
|
||||
'thirdPartyLabel' => '3party',
|
||||
],
|
||||
$period,
|
||||
[
|
||||
|
Reference in New Issue
Block a user