mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: Minor fixes to FunctionalTest
This commit is contained in:
parent
6fcbad1a31
commit
b43bf68f9c
@ -96,8 +96,12 @@ class TestSession {
|
|||||||
$form->setField(new SimpleByName($k), $v);
|
$form->setField(new SimpleByName($k), $v);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($button) $submission = $form->submitButton(new SimpleByName($button));
|
if($button) {
|
||||||
else $submission = $form->submit();
|
$submission = $form->submitButton(new SimpleByName($button));
|
||||||
|
if(!$submission) throw new Exception("Can't find button '$button' to submit as part of test.");
|
||||||
|
} else {
|
||||||
|
$submission = $form->submit();
|
||||||
|
}
|
||||||
|
|
||||||
$url = Director::makeRelative($form->getAction()->asString());
|
$url = Director::makeRelative($form->getAction()->asString());
|
||||||
|
|
||||||
@ -137,6 +141,15 @@ class TestSession {
|
|||||||
return $this->lastResponse;
|
return $this->lastResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the fake HTTP_REFERER; set each time get() or post() is called.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function lastUrl() {
|
||||||
|
return $this->lastUrl;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the most recent response's content
|
* Get the most recent response's content
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user