*
* 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:----cEDh3bHnN3HoqJ6IvT4JTR1mc/xLWPqXbqtl1Fchj+s9Pa9bkdBmaLq77wio/WcOuB1so1YoREsp2k2vx0MgZVqpUi4lJ4pua0xtI/DjDgcWDq3iQv7s1sEHV4B9/FxnAClHEGM4v1Nlj72TXKNaEcmWFX4o+4U1+91QRkU9CLG69w2ZQLWIO9rmHFan3RuzFYvLyQvv1Wsg5ojHgQYjdxT+y4NcTJn2TbZWPuYGAUh94gS5lfmF1r/1dIEKf0YKX/aDZqRHCgU584zRdKtMmR7sod/mAfHBT8mTpvQ2b/hRrKR6ZMQDBR1kcuvL65q1+Vs8myAAT539REQLjG2at59AUVakGZFhpfivOAjdlOcdsqq31L5CzfQqc4t0rINdw/rBNZrvIkbPuQrM0+TXTd1BsBWTvK+RVvUKcD5nhOQ4lON5l0GAwJWsl0IzYY3+f4oOw4JexszE3jKoWxFMA7X8DGF53qkpId7zvKGgt/QqldykX4xmYk5fXmRjtTQpB/aVx1VSguJcoyi5pCrGLode9366lLQAI98Bi7sUvdLLQyRrXhQu/R+OkpzUW4QNq4JKmCbhSx0pl/eV08YgAXr+ukypxnxYPbd2RYMtH1tjWmaBXR1QQ5qzX8iyEW5CyINSPROAXl94uC0G4UtViuUK5jYa7nV11Q9xJn3y1Fk=----ATTACHMENT:----NzAwMDAwMzQ4MzA0NTcyMyA2ODUzNjkwNzQ0Mzc3NDg1IDg4NDIxNDA4NTEwNzgxNjQ=