mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
cs: Fix code style (safe rules only).
This commit is contained in:
@@ -1,47 +1,56 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 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\CalendarBundle\Tests\Controller;
|
||||
|
||||
use Chill\PersonBundle\Repository\AccompanyingPeriodRepository;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use function random_int;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @coversNothing
|
||||
*/
|
||||
class CalendarControllerTest extends WebTestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before each test method (see phpunit doc)
|
||||
* Setup before each test method (see phpunit doc).
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
static::bootKernel();
|
||||
$this->client = static::createClient(array(), array(
|
||||
'PHP_AUTH_USER' => 'center a_social',
|
||||
'PHP_AUTH_PW' => 'password',
|
||||
));
|
||||
$this->client = static::createClient([], [
|
||||
'PHP_AUTH_USER' => 'center a_social',
|
||||
'PHP_AUTH_PW' => 'password',
|
||||
]);
|
||||
}
|
||||
|
||||
public function provideAccompanyingPeriod(): iterable
|
||||
{
|
||||
static::bootKernel();
|
||||
$em= static::$container->get(EntityManagerInterface::class);
|
||||
$em = static::$container->get(EntityManagerInterface::class);
|
||||
|
||||
$nb = $em->createQueryBuilder()
|
||||
->from(AccompanyingPeriod::class, 'ac')
|
||||
->select('COUNT(ac) AS nb')
|
||||
->getQuery()
|
||||
->getSingleScalarResult()
|
||||
;
|
||||
->getSingleScalarResult();
|
||||
|
||||
yield [ $em->createQueryBuilder()
|
||||
yield [$em->createQueryBuilder()
|
||||
->from(AccompanyingPeriod::class, 'ac')
|
||||
->select('ac.id')
|
||||
->setFirstResult(\random_int(0, $nb))
|
||||
->setFirstResult(random_int(0, $nb))
|
||||
->setMaxResults(1)
|
||||
->getQuery()
|
||||
->getSingleScalarResult()
|
||||
->getSingleScalarResult(),
|
||||
];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user