Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR: Minor fixes to FunctionalTest

  • Loading branch information...
commit b43bf68f9c5b1396ae50db6a1ea087efb7b3b19f 1 parent 6fcbad1
Sam Minnée sminnee authored chillu committed
Showing with 15 additions and 2 deletions.
  1. +15 −2 dev/TestSession.php
17 dev/TestSession.php
View
@@ -96,8 +96,12 @@ public function submitForm($formID, $button = null, $data = array()) {
$form->setField(new SimpleByName($k), $v);
}
- if($button) $submission = $form->submitButton(new SimpleByName($button));
- else $submission = $form->submit();
+ if($button) {
+ $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());
@@ -138,6 +142,15 @@ public function 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
*/
public function lastContent() {
Please sign in to comment.
Something went wrong with that request. Please try again.