use Symfony\Component\Form\Exception\BadMethodCallException;
use Symfony\Component\Form\FormRenderer;
use Symfony\Component\Form\FormView;
use Symfony\Component\Form\Tests\Fixtures\DummyFormRendererEngine;
class FormRendererTest extends TestCase
{ public function testHumanize() { $renderer =
new FormRenderer(new DummyFormRendererEngine());
$this->
assertEquals('Is active',
$renderer->
humanize('is_active'
));
$this->
assertEquals('Is active',
$renderer->
humanize('isActive'
));
} public function testRenderARenderedField() { $this->
expectException(BadMethodCallException::
class);
$this->
expectExceptionMessage('Field "foo" has already been rendered, save the result of previous render call to a variable and output that instead.'
);
$formView =
new FormView();
$formView->vars
['name'
] = 'foo';
$formView->
setRendered();