BUGFIX: TestSession::submitForm throws proper error if form not found (from r104972)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112413 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-10-15 01:18:22 +00:00
parent 72e9ce08be
commit 86cae58d4c

View File

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