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/HiddenFieldTest.php

31 lines
657 B
PHP

<?php
namespace Symfony\Tests\Components\Form;
use Symfony\Components\Form\HiddenField;
class HiddenFieldTest extends \PHPUnit_Framework_TestCase
{
protected $field;
public function setUp()
{
$this->field = new HiddenField('name');
}
public function testRender()
{
$this->field->setData('foobar');
$html = '<input id="name" name="name" value="foobar" type="hidden" class="foobar" />';
$this->assertEquals($html, $this->field->render(array(
'class' => 'foobar',
)));
}
public function testIsHidden()
{
$this->assertTrue($this->field->isHidden());
}
}