mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
72e9ce08be
commit
86cae58d4c
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user