* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ 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 * * @author Julien Fastré */ 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', NumberType::class, array( 'post_text' => 'my text' ))->getForm(); $view = $form->createView(); $this->assertEquals('my text', $view['test']->vars['post_text']); } }