mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
fix deprecations: use fqcn
This commit is contained in:
parent
654f7b4d26
commit
00bbbd32d6
@ -30,6 +30,7 @@ use Symfony\Bundle\TwigBundle\TwigEngine;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||
|
||||
/**
|
||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||
@ -122,7 +123,7 @@ class CustomFieldText extends AbstractCustomField
|
||||
public function buildOptionsForm(FormBuilderInterface $builder)
|
||||
{
|
||||
return $builder
|
||||
->add(self::MAX_LENGTH, 'integer', array('empty_data' => 256))
|
||||
->add(self::MAX_LENGTH, IntegerType::class, array('empty_data' => 256))
|
||||
->add(self::MULTIPLE_CF_INLINE, ChoiceType::class, array(
|
||||
'choices' => array(
|
||||
'Multiple boxes on the line' => '1',
|
||||
|
@ -20,6 +20,7 @@
|
||||
namespace Chill\CustomFields\Tests\Form\Extension;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||
|
||||
/**
|
||||
* Test the post-text extension
|
||||
@ -33,26 +34,26 @@ class PostTextIntegerExtensionTest extends KernelTestCase
|
||||
* @var \Symfony\Component\Form\FormBuilderInterface
|
||||
*/
|
||||
private $formBuilder;
|
||||
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
|
||||
$container = self::$kernel->getContainer();
|
||||
|
||||
|
||||
$this->formBuilder = $container->get('form.factory')
|
||||
->createBuilder('form', null);
|
||||
}
|
||||
|
||||
|
||||
public function testCreateView()
|
||||
{
|
||||
$form = $this->formBuilder->add('test', 'integer', array(
|
||||
$form = $this->formBuilder->add('test', IntegerType::class, array(
|
||||
'post_text' => 'my text'
|
||||
))->getForm();
|
||||
|
||||
|
||||
$view = $form->createView();
|
||||
|
||||
|
||||
$this->assertEquals('my text', $view['test']->vars['post_text']);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
namespace Chill\CustomFields\Tests\Form\Extension;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||
|
||||
/**
|
||||
* Test the post-text extension
|
||||
@ -33,26 +34,26 @@ class PostTextNumberExtensionTest extends KernelTestCase
|
||||
* @var \Symfony\Component\Form\FormBuilderInterface
|
||||
*/
|
||||
private $formBuilder;
|
||||
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
|
||||
$container = self::$kernel->getContainer();
|
||||
|
||||
|
||||
$this->formBuilder = $container->get('form.factory')
|
||||
->createBuilder('form', null);
|
||||
}
|
||||
|
||||
|
||||
public function testCreateView()
|
||||
{
|
||||
$form = $this->formBuilder->add('test', 'number', array(
|
||||
$form = $this->formBuilder->add('test', NumberType::class, array(
|
||||
'post_text' => 'my text'
|
||||
))->getForm();
|
||||
|
||||
|
||||
$view = $form->createView();
|
||||
|
||||
|
||||
$this->assertEquals('my text', $view['test']->vars['post_text']);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user