PHPUnit_TestDecorator

A Decorator for Tests.

Defined (1)

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

/src/xmlrpc-3.0/test/PHPUnit/TestDecorator.php  
  1. class PHPUnit_TestDecorator { 
  2. /** 
  3. * The Test to be decorated. 
  4. * @var object 
  5. * @access protected 
  6. */ 
  7. var $_test = NULL; 
  8.  
  9. /** 
  10. * Constructor. 
  11. * @param object 
  12. * @access public 
  13. */ 
  14. function PHPUnit_TestDecorator(&$test) { 
  15. if (is_object($test) && 
  16. (is_a($test, 'PHPUnit_TestCase') || 
  17. is_a($test, 'PHPUnit_TestSuite'))) { 
  18.  
  19. $this->_test = &$test; 
  20.  
  21. /** 
  22. * Runs the test and collects the 
  23. * result in a TestResult. 
  24. * @param object 
  25. * @access public 
  26. */ 
  27. function basicRun(&$result) { 
  28. $this->_test->run($result); 
  29.  
  30. /** 
  31. * Counts the number of test cases that 
  32. * will be run by this test. 
  33. * @return integer 
  34. * @access public 
  35. */ 
  36. function countTestCases() { 
  37. return $this->_test->countTestCases(); 
  38.  
  39. /** 
  40. * Returns the test to be run. 
  41. * @return object 
  42. * @access public 
  43. */ 
  44. function &getTest() { 
  45. return $this->_test; 
  46.  
  47. /** 
  48. * Runs the decorated test and collects the 
  49. * result in a TestResult. 
  50. * @param object 
  51. * @access public 
  52. * @abstract 
  53. */ 
  54. function run(&$result) { /** abstract */ } 
  55.  
  56. /** 
  57. * Returns a string representation of the test. 
  58. * @return string 
  59. * @access public 
  60. */ 
  61. function toString() { 
  62. return $this->_test->toString();