This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/Symfony/Tests/Components/Form/TextareaFieldTest.php

30 lines
761 B
PHP
Raw Normal View History

<?php
namespace Symfony\Tests\Components\Form;
require_once __DIR__ . '/../../../../bootstrap.php';
use Symfony\Components\Form\TextareaField;
class TextareaFieldTest extends \PHPUnit_Framework_TestCase
{
public function testRender()
{
$field = new TextareaField('name');
$field->setData('asdf');
$html = '<textarea id="name" name="name" rows="30" cols="4" class="foobar">asdf</textarea>';
$this->assertEquals($html, $field->render(array('class' => 'foobar')));
}
public function testRenderEscapesValue()
{
$field = new TextareaField('name');
$field->setData('<&&amp;');
$html = '<textarea id="name" name="name" rows="30" cols="4">&lt;&amp;&amp;</textarea>';
$this->assertEquals($html, $field->render());
}
}