Development

Changeset 8454

You must first sign up to be able to contribute.

Changeset 8454

Show
Ignore:
Timestamp:
04/14/08 19:57:31 (1 year ago)
Author:
fabien
Message:

added an error message when a request throws an unexpected exception

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/test/sfTestBrowser.class.php

    r7723 r8454  
    348348      } 
    349349    } 
     350 
     351    $this->resetCurrentException(); 
    350352 
    351353    return $this; 
  • branches/1.1/lib/util/sfBrowser.class.php

    r8225 r8454  
    161161  public function call($uri, $method = 'get', $parameters = array(), $changeStack = true) 
    162162  { 
     163    // check that the previous call() hasn't returned an uncatched exception 
     164    $this->checkCurrentExceptionIsEmpty(); 
     165 
    163166    $uri = $this->fixUri($uri); 
    164167 
     
    428431 
    429432  /** 
    430    * Gets current exception 
     433   * Gets current exception. 
    431434   * 
    432435   * @return sfException 
     
    435438  { 
    436439    return $this->currentException; 
     440  } 
     441 
     442  /** 
     443   * Resets the current exception. 
     444   */ 
     445  public function resetCurrentException() 
     446  { 
     447    $this->currentException = null; 
     448  } 
     449 
     450  public function checkCurrentExceptionIsEmpty() 
     451  { 
     452    if (is_null($this->getCurrentException())) 
     453    { 
     454      return; 
     455    } 
     456 
     457    $this->test->fail(sprintf('last request threw an uncatched exception "%s: %s"', get_class($this->getCurrentException()), $this->getCurrentException()->getMessage())); 
    437458  } 
    438459 
     
    684705  public function shutdown() 
    685706  { 
     707    $this->checkCurrentExceptionIsEmpty(); 
     708 
    686709    // we remove all session data 
    687710    sfToolkit::clearDirectory(sfConfig::get('sf_test_cache_dir').'/sessions'); 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.