mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
49 lines
1.1 KiB
PHP
49 lines
1.1 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
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.
|
|
*
|
|
* @internal
|
|
* @coversNothing
|
|
*/
|
|
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', IntegerType::class, [
|
|
'post_text' => 'my text',
|
|
])->getForm();
|
|
|
|
$view = $form->createView();
|
|
|
|
$this->assertEquals('my text', $view['test']->vars['post_text']);
|
|
}
|
|
}
|