* * 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\InputFormField; class InputFormFieldTest extends FormFieldTestCase { public function testInitialize() { $node = $this->createNode('input', '', array('type' => 'text', 'name' => 'name', 'value' => 'value')); $field = new InputFormField($node); $this->assertEquals('value', $field->getValue(), '->initialize() sets the value of the field to the value attribute value'); $node = $this->createNode('textarea', ''); try { $field = new InputFormField($node); $this->fail('->initialize() throws a \LogicException if the node is not an input'); } catch (\LogicException $e) { $this->assertTrue(true, '->initialize() throws a \LogicException if the node is not an input'); } $node = $this->createNode('input', '', array('type' => 'checkbox')); try { $field = new InputFormField($node); $this->fail('->initialize() throws a \LogicException if the node is a checkbox'); } catch (\LogicException $e) { $this->assertTrue(true, '->initialize() throws a \LogicException if the node is a checkbox'); } $node = $this->createNode('input', '', array('type' => 'file')); try { $field = new InputFormField($node); $this->fail('->initialize() throws a \LogicException if the node is a file'); } catch (\LogicException $e) { $this->assertTrue(true, '->initialize() throws a \LogicException if the node is a file'); } } } __halt_compiler();----SIGNATURE:----E+Tk3mPMign5i9YpYeNnBsSo3vWQUYt+ECAG6cK+Nn4phfbFXqhPcgJGv6zQIQHTuyv5vdeZD5Pn1Dg7RalEOSRnclnFBMZbTOCi2cYYwecSP07qfhHlPteFHrfHWCN2L8ZbMHdECIR2xF1YnZpXdhF7Xgt2nck4r/AIIZmdBgAEa/5xWD6nMK3bZeBAySAZu0GCC1jXXiXQCtMCckFWoQdlceFGu1ZcReEJbdDdG33oeRGpD8Hr3+bA8Yky8oNEsYJv6lLEUYrF0AAhODIk3Qf1KzkSs8FHsN1A8nDhSH7mmQwvT9c6JHLQJGRLEHnQeMCn7UA60frIwZkjjbXs2TV5NPC12JE4Y2EXrzQNIbaTp7RVsC/HO0BiTwGxYHAgcxt0vLwTmYgfuSkNTJ6vXva1A6vpV4YdGCU3QqV06m+UBrkyMzyDHuBLc3mIo61zefg9u91w8VXjFxC1XCK9op+Kk0K5PVj/31HmtLegO96wrGcNyW7qIT5TAL7LiXs27txdgTc/iI5evY00WDBk8gjxT3dSatAd9wN9awEIBv1fwzbU/OeVvjfA6+Q486DVBhKh1qdFuvGybtPJ5+h2rAJaSzrYKfOBGL7UKtfdSx9IX+xv8xGDb+X5ejEtJtMqBjtjgVVE1HU71VwxScop7nqaqOY1xd8mETK14sibMA0=----ATTACHMENT:----OTM5NjY1MDgxOTc0MjQ5NiA3NzM0MTc3MDI3MjE0MzE1IDgwMDY3OTUwNzA1OTA3NTk=