* * 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:----lf8SGKoFsMkImZxKw43ZStJM2zxWXOME72VI6mwS8KuG4i6h4Y5ERmLBdaROyNJRu3hg1nAC44EEXLxYV6YY9hNWtOK256ywR0uxLKycFKQdmlSFRNezmhQON7jRBLsIyDDgMT/XUeubRAJexX1y9Nvyz/eDJeYtQTEaPBlwWEC1CB8h4tEFvQ8BVUd95rAJDh3E5mU4vJPkUnSnaRFZeQcZyi0C5gst112+TJzzvuq2Mk5aOUmNq30fQbO5gSQJQgKT8tCsgb1M2CPCHdEqtML7GLQB0Po6HT/Yjcaje2d3IhJ4SYB7f56PVJXtJz8LlVH2JpSgrW7UhUvTRsdIakeUpMfoiVw8m+fT9OhjcALa3MXU9F9QqIdOVS2+cUU7sMhbEG4OWDTjarOIn3Qj765AkG6Q6EugsGJX+++vONOYBZd+Q+V0tQDa+tGwnQpsBZ2TX8D4QRzM2lJyvAK2eYjP/4dOVMnIvb7ZymS3ivBQAhURzQmsLE6N+OjkIlz1TXWb+A0/OjrfHrtxHkq3q+w5R9om44SsHDF+W221wphnG+PWpuBfa1ZjoWirHVfrkd6BrWTGlyPLhnAZxyVHZecUv5On8gDKTjlL36xSoHHyuYSmxoOh4Hk6FKmC6p8fm19/sLrp/+suPXJAFrokOXeE6z9wJkgVXJWrNpshWeE=----ATTACHMENT:----NDQ4NTk5NTI0NjEyMzYzMCA4MzA1ODczMTMxNTQ3OTQ3IDE2MzAyMzM3NzQwMzU2ODY=