*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\DomCrawler\Tests\Field;
use Symfony\Component\DomCrawler\Field\TextareaFormField;
class TextareaFormFieldTest extends FormFieldTestCase
{
public function testInitialize()
{
$node = $this->createNode('textarea', 'foo bar');
$field = new TextareaFormField($node);
$this->assertEquals('foo bar', $field->getValue(), '->initialize() sets the value of the field to the textarea node value');
$node = $this->createNode('input', '');
try {
$field = new TextareaFormField($node);
$this->fail('->initialize() throws a \LogicException if the node is not a textarea');
} catch (\LogicException $e) {
$this->assertTrue(true, '->initialize() throws a \LogicException if the node is not a textarea');
}
// Ensure that valid HTML can be used on a textarea.
$node = $this->createNode('textarea', 'foo bar
Baz
');
$field = new TextareaFormField($node);
$this->assertEquals('foo bar Baz
', $field->getValue(), '->initialize() sets the value of the field to the textarea node value');
// Ensure that we don't do any DOM manipulation/validation by passing in
// "invalid" HTML.
$node = $this->createNode('textarea', 'foo bar Baz');
$field = new TextareaFormField($node);
$this->assertEquals('foo bar Baz', $field->getValue(), '->initialize() sets the value of the field to the textarea node value');
}
}
__halt_compiler();----SIGNATURE:----OvYTbURxxcwHKNuEN37/s62kx8tlcb3YXsamkc+aC3axQNsEtS2gDgZeJIcyCWOQnwEIDB6Jc8xBUbRaudfvtu/R2/UOZ/v4URQAEXp0j3FKEIPVsJctc5oPdfshg6U0EtS8iQdtPJYgT0bqVhnJVxxdtZzupHR3C9OEPqW8xnWzlh3piW4lE6PWTkDPYugJtu680Wo3bidrKzp07u0AMlRwO1tUlSrYznYBUyn7nL3dFm1GGtp0n71oOl5orIOqPoA+Lpq6caa8e3XMwaOcGoZmllQtXfTugrmT8fGXbOujxUXwipEGSJyk4qruUbjUSYmuklxLQKNpUVFM3tOc5fYhnUnbY9UsMXNCQPLL+me2SssHVLYKcJhQtYfJc5+KwwkyXggFxQJL+KWvf9KMBIjh0ILxjo5fK5OHnaW4XeGlTOVncMWU3fTfqzR3u291qC6T4LubcI2ullDuzrVhpp8QujNr+hbh5Zwp2Dcz0nQ8wZXwH1PCVWnS4Lfn3m92y/PJe3LQvX7BZgPahvAQGcI3R9sMu1bCPc5frzNkGhu3H8dDWQmoXN+ecE3ssjc8UTCKfRggw+va5fwLBELWb4+BJuqXMuMD0V2Skcv5Vu0dC8jJU8/6+LJy0uh6Yn2FpNhkzeUAVTlVGkTbknmSPFDPKBKPT+ATRNgLY2knrsk=----ATTACHMENT:----OTA3MTUwNzY4Njg0ODczMSA0Njc5MDY4NzUzNTg3NDc1IDQ3MzY3ODgwNzAwNjAzODM=