mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-10 16:55:00 +00:00
cs: Switch to a stricter way of coding - this might break in a lot of places.
This commit is contained in:
@@ -7,6 +7,15 @@
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers.
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Chill\ReportBundle\Tests\Controller;
|
||||
|
||||
use Chill\CustomFieldsBundle\Entity\CustomFieldsGroup;
|
||||
@@ -24,7 +33,7 @@ use function in_array;
|
||||
* @internal
|
||||
* @coversNothing
|
||||
*/
|
||||
class ReportControllerNextTest extends WebTestCase
|
||||
final class ReportControllerNextTest extends WebTestCase
|
||||
{
|
||||
/**
|
||||
* @var CustomFieldsGroup
|
||||
@@ -38,9 +47,9 @@ class ReportControllerNextTest extends WebTestCase
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
static::bootKernel();
|
||||
self::bootKernel();
|
||||
// get person from fixture
|
||||
$em = static::$kernel->getContainer()
|
||||
$em = self::$kernel->getContainer()
|
||||
->get('doctrine.orm.entity_manager');
|
||||
|
||||
$this->person = $em
|
||||
@@ -59,7 +68,7 @@ class ReportControllerNextTest extends WebTestCase
|
||||
}
|
||||
|
||||
// get custom fields group from fixture
|
||||
$customFieldsGroups = static::$kernel->getContainer()
|
||||
$customFieldsGroups = self::$kernel->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup')
|
||||
->findBy(['entity' => 'Chill\ReportBundle\Entity\Report']);
|
||||
@@ -67,7 +76,7 @@ class ReportControllerNextTest extends WebTestCase
|
||||
$filteredCustomFieldsGroupHouse = array_filter(
|
||||
$customFieldsGroups,
|
||||
static function (CustomFieldsGroup $group) {
|
||||
return in_array('Situation de logement', $group->getName());
|
||||
return in_array('Situation de logement', $group->getName(), true);
|
||||
}
|
||||
);
|
||||
$this->group = $filteredCustomFieldsGroupHouse[0];
|
||||
@@ -92,7 +101,7 @@ class ReportControllerNextTest extends WebTestCase
|
||||
public function testUngrantedUserIsDeniedAccessOnReport()
|
||||
{
|
||||
$client = $this->getAuthenticatedClient('center b_social');
|
||||
$reports = static::$kernel->getContainer()->get('doctrine.orm.entity_manager')
|
||||
$reports = self::$kernel->getContainer()->get('doctrine.orm.entity_manager')
|
||||
->getRepository('ChillReportBundle:Report')
|
||||
->findBy(['person' => $this->person]);
|
||||
$report = $reports[0];
|
||||
@@ -165,7 +174,7 @@ class ReportControllerNextTest extends WebTestCase
|
||||
|
||||
protected function getAuthenticatedClient($username = 'center a_social')
|
||||
{
|
||||
return static::createClient([], [
|
||||
return self::createClient([], [
|
||||
'PHP_AUTH_USER' => $username,
|
||||
'PHP_AUTH_PW' => 'password',
|
||||
]);
|
||||
|
Reference in New Issue
Block a user