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