Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")
class HelpTestCase extends WebTestCase
{
function testDefaultsToIndexOfQuestions()
{
$this->get('http://help.yogler.com/');
$this->assertResponse(200);
$this->assertWantedPattern('/yogler.com help/i');
$this->assertField('q');
$this->submitFormById('search');
$this->assertResponse(200, 'If this does not pass, check that the index tests pass first. Error: %s; Current URL: ' . $this->getUrl());
}
}
<html><body>yogler.com help <form id="submit" method="get" action="/search"><input name="q" /></form></body></html>
The one fail that SimpleTest comes up with is
If this does not pass, check that the index tests pass first. Error: Expecting response in [200] got []; Current URL: at line [20]
So... it appears to me that it does not like submitting the form by the id... but why? Submitting the form manually by hitting enter when the input box is in focus works as intended.
- Nathaniel
Last edited by Nathaniel on Fri Jun 09, 2006 7:18 pm, edited 1 time in total.