/vendor/phpunit/phpunit/src/Framework/SkippedTestCase.php

https://bitbucket.org/alan_cordova/api-sb-map · PHP · 80 lines · 27 code · 10 blank · 43 comment · 0 complexity · 2b6213a1d58e8897b72e014789f6409e MD5 · raw file

  1. <?php
  2. /*
  3. * This file is part of PHPUnit.
  4. *
  5. * (c) Sebastian Bergmann <sebastian@phpunit.de>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. /**
  11. * A skipped test case
  12. */
  13. class PHPUnit_Framework_SkippedTestCase extends PHPUnit_Framework_TestCase
  14. {
  15. /**
  16. * @var string
  17. */
  18. protected $message = '';
  19. /**
  20. * @var bool
  21. */
  22. protected $backupGlobals = false;
  23. /**
  24. * @var bool
  25. */
  26. protected $backupStaticAttributes = false;
  27. /**
  28. * @var bool
  29. */
  30. protected $runTestInSeparateProcess = false;
  31. /**
  32. * @var bool
  33. */
  34. protected $useErrorHandler = false;
  35. /**
  36. * @var bool
  37. */
  38. protected $useOutputBuffering = false;
  39. /**
  40. * @param string $message
  41. */
  42. public function __construct($className, $methodName, $message = '')
  43. {
  44. $this->message = $message;
  45. parent::__construct($className . '::' . $methodName);
  46. }
  47. /**
  48. * @throws PHPUnit_Framework_Exception
  49. */
  50. protected function runTest()
  51. {
  52. $this->markTestSkipped($this->message);
  53. }
  54. /**
  55. * @return string
  56. */
  57. public function getMessage()
  58. {
  59. return $this->message;
  60. }
  61. /**
  62. * Returns a string representation of the test case.
  63. *
  64. * @return string
  65. */
  66. public function toString()
  67. {
  68. return $this->getName();
  69. }
  70. }