cs: Second part - ignore test/app subdirectory.

This commit is contained in:
Pol Dellaiera
2021-11-23 14:34:34 +01:00
parent 5f37304796
commit 3ea35682eb
72 changed files with 326 additions and 365 deletions

View File

@@ -59,8 +59,7 @@ class LoadCustomFieldsGroup extends AbstractFixture implements OrderedFixtureInt
ObjectManager $manager,
array $name,
array $options = []
)
{
) {
echo $name['fr'] . " \n";
$cFGroup = (new CustomFieldsGroup())

View File

@@ -38,19 +38,19 @@ class ChillReportExtension extends Extension implements PrependExtensionInterfac
$container->prependExtensionConfig(
'chill_custom_fields',
['customizables_entities' => [
[
'class' => 'Chill\ReportBundle\Entity\Report',
'name' => 'ReportEntity',
'options' => [
'summary_fields' => [
'form_type' => LinkedCustomFieldsType::class,
'form_options' => [
'multiple' => true,
'expanded' => false,
],
[
'class' => 'Chill\ReportBundle\Entity\Report',
'name' => 'ReportEntity',
'options' => [
'summary_fields' => [
'form_type' => LinkedCustomFieldsType::class,
'form_options' => [
'multiple' => true,
'expanded' => false,
],
], ],
],
],
], ],
],
]
);
}

View File

@@ -49,8 +49,7 @@ class ReportType extends AbstractType
TokenStorageInterface $tokenStorage,
TranslatableStringHelper $translatableStringHelper,
ObjectManager $om
)
{
) {
$this->authorizationHelper = $helper;
$this->user = $tokenStorage->getToken()->getUser();
$this->translatableStringHelper = $translatableStringHelper;

View File

@@ -46,8 +46,7 @@ class ReportSearch extends AbstractSearch implements ContainerAwareInterface
EntityManagerInterface $em,
AuthorizationHelper $helper,
TokenStorageInterface $tokenStorage
)
{
) {
$this->em = $em;
$this->helper = $helper;
@@ -99,9 +98,9 @@ class ReportSearch extends AbstractSearch implements ContainerAwareInterface
);
$whereElement->add(
$qb->expr()->andX(
$qb->expr()->eq('p.center', ':center_' . $i),
$qb->expr()->in('r.scope', ':reachable_scopes_' . $i)
)
$qb->expr()->eq('p.center', ':center_' . $i),
$qb->expr()->in('r.scope', ':reachable_scopes_' . $i)
)
);
$qb->setParameter('center_' . $i, $center);
$qb->setParameter('reachable_scopes_' . $i, $reachableScopesId);

View File

@@ -66,8 +66,8 @@ class ReportControllerNextTest extends WebTestCase
$filteredCustomFieldsGroupHouse = array_filter(
$customFieldsGroups,
function (CustomFieldsGroup $group) {
return in_array('Situation de logement', $group->getName());
}
return in_array('Situation de logement', $group->getName());
}
);
$this->group = $filteredCustomFieldsGroupHouse[0];
}

View File

@@ -83,8 +83,8 @@ class ReportControllerTest extends WebTestCase
$filteredCustomFieldsGroupHouse = array_filter(
$customFieldsGroups,
function (CustomFieldsGroup $group) {
return in_array('Situation de logement', $group->getName());
}
return in_array('Situation de logement', $group->getName());
}
);
static::$group = $filteredCustomFieldsGroupHouse[0];
@@ -136,7 +136,7 @@ class ReportControllerTest extends WebTestCase
$this->assertGreaterThan(
1,
count($form->get(self::REPORT_NAME_FIELD)
->availableOptionValues()),
->availableOptionValues()),
'I can choose between report models'
);
@@ -253,9 +253,9 @@ class ReportControllerTest extends WebTestCase
);
$this->assertContains(
sprintf(
'/fr/person/%d/report/select/type/for/creation',
static::$person->getId()
),
'/fr/person/%d/report/select/type/for/creation',
static::$person->getId()
),
$link->getUri(),
'There is a "add a report" link in menu'
);
@@ -334,10 +334,10 @@ class ReportControllerTest extends WebTestCase
$this->assertTrue($client->getResponse()->isRedirect(
sprintf(
'/fr/person/%s/report/%s/view',
static::$person->getId(),
$reportId
)
'/fr/person/%s/report/%s/view',
static::$person->getId(),
$reportId
)
));
$this->assertEquals(new DateTime('yesterday'), static::$kernel->getContainer()
@@ -416,8 +416,7 @@ class ReportControllerTest extends WebTestCase
Person $person,
CustomFieldsGroup $group,
\Symfony\Component\BrowserKit\Client $client
)
{
) {
$url = sprintf(
'fr/person/%d/report/cfgroup/%d/new',
$person->getId(),

View File

@@ -25,9 +25,9 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
*/
class ReportVoterTest extends KernelTestCase
{
use PrepareUserTrait;
use PrepareCenterTrait;
use PrepareScopeTrait;
use PrepareUserTrait;
/**
* @var \Prophecy\Prophet
@@ -131,8 +131,7 @@ class ReportVoterTest extends KernelTestCase
$action,
$message,
?User $user = null
)
{
) {
$token = $this->prepareToken($user);
$result = $this->voter->vote($token, $report, [$action]);
$this->assertEquals($expectedResult, $result, $message);

View File

@@ -62,8 +62,8 @@ class TimelineProviderTest extends WebTestCase
$scopesSocial = array_filter(
static::$em
->getRepository('ChillMainBundle:Scope')
->findAll(),
->getRepository('ChillMainBundle:Scope')
->findAll(),
function (Scope $scope) { return $scope->getName()['en'] === 'social'; }
);
@@ -104,7 +104,7 @@ class TimelineProviderTest extends WebTestCase
$this->assertEquals(
0,
$crawler->filter('.report_entry .summary')
->count(),
->count(),
'the page does not contains a .report .summary element'
);
}
@@ -152,19 +152,19 @@ class TimelineProviderTest extends WebTestCase
$this->assertGreaterThan(
0,
$crawler->filter('.report_entry .summary')
->count(),
->count(),
'the page contains a .report .summary element'
);
$this->assertContains(
'blah blah',
$crawler->filter('.report_entry .summary')
->text(),
->text(),
'the page contains the text "blah blah"'
);
$this->assertContains(
'Propriétaire',
$crawler->filter('.report_entry .summary')
->text(),
->text(),
'the page contains the mention "Propriétaire"'
);
}