BUGFIX: TestSession::submitForm throws proper error if form not found

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@104972 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Luke Hudson 2010-05-17 00:34:29 +00:00 committed by Sam Minnee
parent 9140742fd3
commit 849992a7fa

View File

@ -71,6 +71,9 @@ class TestSession {
$page = $this->lastPage();
if($page) {
$form = $page->getFormById($formID);
if (!$form) {
user_error("TestSession::submitForm failed to find the form {$formID}");
}
foreach($data as $k => $v) {
$form->setField(new SimpleByName($k), $v);