public function postRequest(SS_HTTPRequest $request, SS_HTTPResponse $response, DataModel $model)
 {
     if (!$this->testSessionEnvironment->isRunningTests()) {
         return;
     }
     // Store PHP session
     $state = $this->testSessionEnvironment->getState();
     $state->session = Session::get_all();
     $this->testSessionEnvironment->applyState($state);
 }
 protected function saveEmail($data)
 {
     $state = $this->testSessionEnvironment->getState();
     if (!isset($state->emails)) {
         $state->emails = array();
     }
     $state->emails[] = array_filter($data);
     $this->testSessionEnvironment->applyState($state);
 }
 /**
  * @return ArrayList
  */
 public function getState()
 {
     $stateObj = $this->environment->getState();
     $state = array();
     // Convert the stdObject of state into ArrayData
     foreach ($stateObj as $k => $v) {
         $state[] = new ArrayData(array('Name' => $k, 'Value' => var_export($v, true)));
     }
     return new ArrayList($state);
 }