mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-29 10:05:03 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -33,11 +33,10 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||
use function array_key_exists;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
final class CalendarContextTest extends TestCase
|
||||
@@ -85,13 +84,13 @@ final class CalendarContextTest extends TestCase
|
||||
// so, we expect the call to be twice for each method
|
||||
$formBuilder->add('thirdParty', EntityType::class, Argument::type('array'))
|
||||
->should(static function ($calls, $object, $method) use ($tp1, $tp2) {
|
||||
if (2 !== count($calls)) {
|
||||
throw new FailedPredictionException(sprintf('the $builder->add should be called exactly 2, %d receivved', count($calls)));
|
||||
if (2 !== \count($calls)) {
|
||||
throw new FailedPredictionException(sprintf('the $builder->add should be called exactly 2, %d receivved', \count($calls)));
|
||||
}
|
||||
|
||||
$opts = $calls[0]->getArguments()[2];
|
||||
|
||||
if (!array_key_exists('label', $opts)) {
|
||||
if (!\array_key_exists('label', $opts)) {
|
||||
throw new FailedPredictionException('the $builder->add should have a label key');
|
||||
}
|
||||
|
||||
@@ -105,13 +104,13 @@ final class CalendarContextTest extends TestCase
|
||||
});
|
||||
$formBuilder->add('mainPerson', EntityType::class, Argument::type('array'))
|
||||
->should(static function ($calls, $object, $method) use ($p1) {
|
||||
if (2 !== count($calls)) {
|
||||
throw new FailedPredictionException(sprintf('the $builder->add should be called exactly 2, %d receivved', count($calls)));
|
||||
if (2 !== \count($calls)) {
|
||||
throw new FailedPredictionException(sprintf('the $builder->add should be called exactly 2, %d receivved', \count($calls)));
|
||||
}
|
||||
|
||||
$opts = $calls[0]->getArguments()[2];
|
||||
|
||||
if (!array_key_exists('label', $opts)) {
|
||||
if (!\array_key_exists('label', $opts)) {
|
||||
throw new FailedPredictionException('the $builder->add should have a label key');
|
||||
}
|
||||
|
||||
@@ -178,7 +177,7 @@ final class CalendarContextTest extends TestCase
|
||||
$em = $this->prophesize(EntityManagerInterface::class);
|
||||
$em->persist(Argument::type(CalendarDoc::class))->should(
|
||||
static function ($calls, $object, $method) use ($storedObject) {
|
||||
if (1 !== count($calls)) {
|
||||
if (1 !== \count($calls)) {
|
||||
throw new FailedPredictionException('the persist method should be called once');
|
||||
}
|
||||
|
||||
@@ -189,7 +188,7 @@ final class CalendarContextTest extends TestCase
|
||||
throw new FailedPredictionException('the stored object is not correct');
|
||||
}
|
||||
|
||||
if ($calendarDoc->getStoredObject()->getTitle() !== 'blabla') {
|
||||
if ('blabla' !== $calendarDoc->getStoredObject()->getTitle()) {
|
||||
throw new FailedPredictionException('the doc title should be the one provided');
|
||||
}
|
||||
|
||||
@@ -203,8 +202,8 @@ final class CalendarContextTest extends TestCase
|
||||
}
|
||||
|
||||
private function buildCalendarContext(
|
||||
?EntityManagerInterface $entityManager = null,
|
||||
?NormalizerInterface $normalizer = null
|
||||
EntityManagerInterface $entityManager = null,
|
||||
NormalizerInterface $normalizer = null
|
||||
): CalendarContext {
|
||||
$baseContext = $this->prophesize(BaseContextData::class);
|
||||
$baseContext->getData(null)->willReturn(['base_context' => 'data']);
|
||||
|
Reference in New Issue
Block a user