Пример #1
0
 protected function call($uri, $method = 'get', $params = array())
 {
     // multi testguy implementation
     $_SERVER['session_id'] = $this->session_id;
     if (false === ($empty = $this->browser->checkCurrentExceptionIsEmpty())) {
         \PHPUnit_Framework_Assert::fail(sprintf('last request threw an uncaught exception "%s: %s"', get_class($this->browser->getCurrentException()), $this->browser->getCurrentException()->getMessage()));
         return;
     }
     $this->debug('Request (' . $method . '): ' . $uri . ' ' . json_encode($params));
     $this->browser->call($uri, $method, $params);
     $this->debug('Response code: ' . $this->browser->getResponse()->getStatusCode());
     $this->debug('Response message: ' . $this->browser->getResponse()->getStatusText());
     if ($form = $this->getForm()) {
         foreach ($form->getErrorSchema() as $field => $desc) {
             $this->debug("Error in form {$field} field: '{$desc}'");
         }
     }
     $this->followRedirect();
 }
Пример #2
0
 /**
  * Trigger a test failure if an uncaught exception is present.
  * 
  * @return  bool
  */
 public function checkCurrentExceptionIsEmpty()
 {
     if (false === ($empty = parent::checkCurrentExceptionIsEmpty())) {
         $this->test()->fail(sprintf('last request threw an uncaught exception "%s: %s"', get_class($this->getCurrentException()), $this->getCurrentException()->getMessage()));
     }
     return $empty;
 }