mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-27 00:55:01 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
@@ -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()
|
||||
|
@@ -18,6 +18,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
final class CustomFieldsTextTest extends WebTestCase
|
||||
|
Reference in New Issue
Block a user