PHPUnit_TestFailure

A TestFailure collects a failed test together with the caught exception.

Defined (1)

The class is defined in the following location(s).

/src/xmlrpc-3.0/test/PHPUnit/TestFailure.php  
  1. class PHPUnit_TestFailure { 
  2. /** 
  3. * @var object 
  4. * @access private 
  5. */ 
  6. var $_failedTest; 
  7.  
  8. /** 
  9. * @var string 
  10. * @access private 
  11. */ 
  12. var $_thrownException; 
  13.  
  14. /** 
  15. * Constructs a TestFailure with the given test and exception. 
  16. * @param object 
  17. * @param string 
  18. * @access public 
  19. */ 
  20. function PHPUnit_TestFailure(&$failedTest, &$thrownException) { 
  21. $this->_failedTest = &$failedTest; 
  22. $this->_thrownException = &$thrownException; 
  23.  
  24. /** 
  25. * Gets the failed test. 
  26. * @return object 
  27. * @access public 
  28. */ 
  29. function &failedTest() { 
  30. return $this->_failedTest; 
  31.  
  32. /** 
  33. * Gets the thrown exception. 
  34. * @return object 
  35. * @access public 
  36. */ 
  37. function &thrownException() { 
  38. return $this->_thrownException; 
  39.  
  40. /** 
  41. * Returns a short description of the failure. 
  42. * @return string 
  43. * @access public 
  44. */ 
  45. function toString() { 
  46. return sprintf( 
  47. "TestCase %s->%s() failed: %s\n",  
  48.  
  49. get_class($this->_failedTest),  
  50. $this->_failedTest->getName(),  
  51. $this->_thrownException 
  52. );