php - Submit an array of values with SimpleTest -
i'm trying submit simple form has array of fields:
<form> <input type='text' name='article[]' id='article1' /> <input type='text' name='article[]' id='article2' /> <input type='text' name='article[]' id='article3' />
so, how set different fields using simpletest?
(p.s. i've seen question: simpletest php scriptable browser... how test submit form has [ ] in form name (basically in array format)? doesn't answer question).
i figured out 1 way of doing use setfieldbyid. change code to:
$form->setfieldbyid('article1', 'some article text 1'); $form->setfieldbyid('article2', 'some article text 2');
and on. works assumes can generate unique ids each field -- not difficult.
Comments
Post a Comment