apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -17,6 +17,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
* Test the option Customizables_entities.
*
* @internal
*
* @coversNothing
*/
final class ConfigCustomizablesEntitiesTest extends KernelTestCase

View File

@@ -15,6 +15,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
/**
* @internal
*
* @coversNothing
*/
final class CustomFieldControllerTest_TODO extends WebTestCase

View File

@@ -16,6 +16,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
/**
* @internal
*
* @coversNothing
*/
final class CustomFieldsGroupControllerTest extends WebTestCase
@@ -32,7 +33,7 @@ final class CustomFieldsGroupControllerTest extends WebTestCase
'PHP_AUTH_PW' => 'olala',
]);
//create the entity
// create the entity
$this->createCustomFieldsGroup($client);
// Edit the entity

View File

@@ -33,7 +33,7 @@ trait CustomFieldTestHelper
{
$kernel = static::$kernel;
//check a kernel is accessible
// check a kernel is accessible
$customFieldsGroup = $this->createMock(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class);
$customFieldsGroup->expects($this->once())
->method('getActiveCustomFields')
@@ -55,7 +55,7 @@ trait CustomFieldTestHelper
->getForm();
$kernel->getContainer()->get('twig.loader')
->addPath($kernel->getContainer()->getParameter('kernel.root_dir') .
->addPath($kernel->getContainer()->getParameter('kernel.root_dir').
'/Resources/views/', $namespace = 'test');
$content = $kernel

View File

@@ -23,6 +23,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
* - deserialize
*
* @internal
*
* @coversNothing
*/
final class CustomFieldsChoiceTest extends KernelTestCase
@@ -129,6 +130,7 @@ final class CustomFieldsChoiceTest extends KernelTestCase
* This test does not covers the case when the selected value is `_other`
*
* @param type $data
*
* @dataProvider serializedRepresentationDataProvider
*/
public function testDeserializeMultipleChoiceWithOther($data)
@@ -214,6 +216,7 @@ final class CustomFieldsChoiceTest extends KernelTestCase
* **without** an "allow_other" field.
*
* @param type $data
*
* @dataProvider serializedRepresentationDataProvider
*/
public function testDeserializeMultipleChoiceWithoutOther($data)
@@ -261,7 +264,7 @@ final class CustomFieldsChoiceTest extends KernelTestCase
$deserialized = $this->cfChoice->deserialize($data, $customField);
$this->assertSame([null], $deserialized);
//from single
// from single
$data = ['_other' => null, '_choices' => null];
$deserialized = $this->cfChoice->deserialize($data, $customField);
$this->assertSame([null], $deserialized);
@@ -274,6 +277,7 @@ final class CustomFieldsChoiceTest extends KernelTestCase
* If the value is in _other, the _other value should be in the _other field.
*
* @param type $data
*
* @dataProvider serializedRepresentationDataProvider
*/
public function testDeserializeSingleChoiceWithOther($data)
@@ -311,8 +315,8 @@ final class CustomFieldsChoiceTest extends KernelTestCase
$deserialized = $this->cfChoice->deserialize($data, $customField);
$this->assertSame(['_other' => 'something', '_choices' => '_other'], $deserialized);
//test with null data
//from a single to a single :
// test with null data
// from a single to a single :
$data = ['_other' => 'something', '_choices' => null];
$deserialized = $this->cfChoice->deserialize($data, $customField);
$this->assertSame(['_other' => 'something', '_choices' => null], $deserialized);
@@ -340,11 +344,11 @@ final class CustomFieldsChoiceTest extends KernelTestCase
$this->assertSame(['_other' => '', '_choices' => null], $deserialized);
}
/////////////////////////////////////////
// ///////////////////////////////////////
//
// test function deserialize
//
////////////////////////////////////////
// //////////////////////////////////////
/**
* Test if the representation of the data is deserialized to a single text.
@@ -352,6 +356,7 @@ final class CustomFieldsChoiceTest extends KernelTestCase
* If the value is in _other, the _other value should not be returned.
*
* @param type $data
*
* @dataProvider serializedRepresentationDataProvider
*/
public function testDeserializeSingleChoiceWithoutOther($data)
@@ -409,11 +414,11 @@ final class CustomFieldsChoiceTest extends KernelTestCase
$this->assertTrue($isEmpty);
}
/////////////////////////////////////////
// ///////////////////////////////////////
//
// test function isEmptyValue
//
////////////////////////////////////////
// //////////////////////////////////////
/**
* test the not empty with the not-empty data provider.
*

View File

@@ -11,15 +11,14 @@ declare(strict_types=1);
namespace Chill\CustomFieldsBundle\Tests\CustomFields;
use Chill\CustomFieldsBundle\CustomFields\CustomFieldNumber;
use Chill\CustomFieldsBundle\Entity\CustomField;
use Symfony\Component\Form\FormBuilderInterface;
use function count;
/**
* Test CustomFieldsNumber.
*
* @internal
*
* @coversNothing
*/
final class CustomFieldsNumberTest extends \Symfony\Bundle\FrameworkBundle\Test\WebTestCase
@@ -70,7 +69,7 @@ final class CustomFieldsNumberTest extends \Symfony\Bundle\FrameworkBundle\Test\
$this->assertTrue($form->isSynchronized());
$this->assertFalse($form->isValid());
$this->assertEquals(1, count($form['default']->getErrors()));
$this->assertEquals(1, \count($form['default']->getErrors()));
}
public function testCreateInvalidFormValueLowerThanMinimum()
@@ -90,7 +89,7 @@ final class CustomFieldsNumberTest extends \Symfony\Bundle\FrameworkBundle\Test\
$this->assertTrue($form->isSynchronized());
$this->assertFalse($form->isValid());
$this->assertEquals(1, count($form['default']->getErrors()));
$this->assertEquals(1, \count($form['default']->getErrors()));
}
public function testCreateValidForm()

View File

@@ -18,6 +18,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
/**
* @internal
*
* @coversNothing
*/
final class CustomFieldsTextTest extends WebTestCase

View File

@@ -18,6 +18,7 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType;
* Test the post-text extension.
*
* @internal
*
* @coversNothing
*/
final class PostTextIntegerExtensionTest extends KernelTestCase

View File

@@ -18,6 +18,7 @@ use Symfony\Component\Form\Extension\Core\Type\NumberType;
* Test the post-text extension.
*
* @internal
*
* @coversNothing
*/
final class PostTextNumberExtensionTest extends KernelTestCase

View File

@@ -18,6 +18,7 @@ use Symfony\Component\HttpFoundation\Response;
* Test that routes are correctly loaded.
*
* @internal
*
* @coversNothing
*/
final class RoutingLoaderTest extends WebTestCase

View File

@@ -12,13 +12,13 @@ declare(strict_types=1);
namespace Chill\CustomFields\Tests\Service;
use Chill\CustomFieldsBundle\Entity\CustomField;
use Chill\CustomFieldsBundle\Service\CustomFieldsHelper;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
/**
* Tests for custom fields helper.
*
* @internal
*
* @coversNothing
*/
final class CustomFieldsHelperTest extends KernelTestCase
@@ -52,7 +52,7 @@ final class CustomFieldsHelperTest extends KernelTestCase
$this->assertFalse($this->cfHelper->isEmptyValue($data, $this->randomCFText));
//empty value
// empty value
$data = [
$this->randomCFText->getSlug() => '',
];

View File

@@ -12,14 +12,13 @@ declare(strict_types=1);
namespace Chill\CustomFields\Tests\Templating\Twig;
use Chill\CustomFieldsBundle\Entity\CustomField;
use Chill\CustomFieldsBundle\Service\CustomFieldProvider;
use Chill\CustomFieldsBundle\Templating\Twig\CustomFieldRenderingTwig;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
/**
* Test the rendering of twig function which renders custom fields.
*
* @internal
*
* @coversNothing
*/
final class CustomFieldRenderingTwigTest extends KernelTestCase

View File

@@ -13,8 +13,6 @@ namespace Chill\CustomFields\Tests\Templating\Twig;
use Chill\CustomFieldsBundle\Entity\CustomField;
use Chill\CustomFieldsBundle\Entity\CustomFieldsGroup;
use Chill\CustomFieldsBundle\Service\CustomFieldProvider;
use Chill\CustomFieldsBundle\Templating\Twig\CustomFieldsGroupRenderingTwig;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
/**
@@ -22,6 +20,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
* the `chill_custom_fields_group_widget`.
*
* @internal
*
* @coversNothing
*/
final class CustomFieldsGroupRenderingTwigTest extends KernelTestCase
@@ -93,7 +92,6 @@ final class CustomFieldsGroupRenderingTwigTest extends KernelTestCase
}
/**
*
* @return CustomField
*/
private function getSimpleCustomFieldText(mixed $slug, mixed $name)