TestCase.php 922 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace Codeception\PHPUnit;
  3. abstract class TestCase extends \PHPUnit\Framework\TestCase
  4. {
  5. protected function setUp(): void
  6. {
  7. if (method_exists($this, '_setUp')) {
  8. $this->_setUp();
  9. }
  10. }
  11. protected function tearDown(): void
  12. {
  13. if (method_exists($this, '_tearDown')) {
  14. $this->_tearDown();
  15. }
  16. }
  17. public static function setUpBeforeClass(): void
  18. {
  19. if (method_exists(get_called_class(), '_setUpBeforeClass')) {
  20. static::_setUpBeforeClass();
  21. }
  22. }
  23. public static function tearDownAfterClass(): void
  24. {
  25. if (method_exists(get_called_class(), '_tearDownAfterClass')) {
  26. static::_tearDownAfterClass();
  27. }
  28. }
  29. public function expectExceptionMessageRegExp(string $regularExpression): void
  30. {
  31. $this->expectExceptionMessageMatches($regularExpression);
  32. }
  33. }