From 849992a7fa71bdb0e4144774f770f36f90494298 Mon Sep 17 00:00:00 2001 From: Luke Hudson Date: Mon, 17 May 2010 00:34:29 +0000 Subject: [PATCH] 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 --- dev/TestSession.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dev/TestSession.php b/dev/TestSession.php index 7e3edb496..81c920f88 100644 --- a/dev/TestSession.php +++ b/dev/TestSession.php @@ -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);