#107 setField() returns true, but showRequest() is empty

closed-fixed
Perrick Penet
Web tester (52)
5
2007-12-27
2007-01-23
No

HTML form:

<html>
<body>
<form method="GET">
<input name="tested_field" type="radio" value="1">1</input>
<input name="tested_field" type="radio" value="2">2</input>
<input name="tested_field" type="radio" value="3">3</input>
<input name="send" type="submit" value="click me"/>
</form>
</body>
</html>

Test code:

class TestRadioField extends WebTestCase
{
function testSetField()
{
$this->get('http://localhost/testradiofield.html');
$this->assertTrue($this->setField('tested_field', 2));
$this->clickSubmitByName('send');
$this->showRequest();
}
}

Expected result:

GET /testradiofield.html?tested_field=2&send=click+me HTTP/1.0
Host: localhost
Connection: close

Actual result:

GET /testradiofield.html?send=click+me HTTP/1.0
Host: localhost
Connection: close

If the second parameter of setField() change to string, i.e. $this->setField('tested_field', '2'), the expected result is present, but in both case method setField() returns true.

Discussion

    • summary: setField() returns true? but showRequest() is empty --> setField() returns true, but showRequest() is empty
     
  • Perrick Penet
    Perrick Penet
    2007-12-27

    • assigned_to: lastcraft --> pp11
    • status: open --> closed-fixed
     
  • Perrick Penet
    Perrick Penet
    2007-12-27

    Logged In: YES
    user_id=292377
    Originator: NO

    Thans for the report. I added your test to SimpleTest's suite and changed a check from "!==" to "!=" : it means everything is OK in the SVN trunk. Enjoy...

    Yours,
    Perrick