Changeset 51846 for branches/5.2/tests/phpunit/includes/testcase.php
- Timestamp:
- 09/22/2021 12:09:05 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.2/tests/phpunit/includes/testcase.php
r44701 r51846 1 1 <?php 2 2 3 require_once dirname( __FILE__ ) . '/abstract-testcase.php'; 3 use Yoast\PHPUnitPolyfills\Helpers\AssertAttributeHelper; 4 use Yoast\PHPUnitPolyfills\Polyfills\AssertClosedResource; 5 use Yoast\PHPUnitPolyfills\Polyfills\AssertEqualsSpecializations; 6 use Yoast\PHPUnitPolyfills\Polyfills\AssertFileDirectory; 7 use Yoast\PHPUnitPolyfills\Polyfills\AssertFileEqualsSpecializations; 8 use Yoast\PHPUnitPolyfills\Polyfills\AssertionRenames; 9 use Yoast\PHPUnitPolyfills\Polyfills\AssertIsType; 10 use Yoast\PHPUnitPolyfills\Polyfills\AssertNumericType; 11 use Yoast\PHPUnitPolyfills\Polyfills\AssertObjectEquals; 12 use Yoast\PHPUnitPolyfills\Polyfills\AssertStringContains; 13 use Yoast\PHPUnitPolyfills\Polyfills\EqualToSpecializations; 14 use Yoast\PHPUnitPolyfills\Polyfills\ExpectException; 15 use Yoast\PHPUnitPolyfills\Polyfills\ExpectExceptionMessageMatches; 16 use Yoast\PHPUnitPolyfills\Polyfills\ExpectExceptionObject; 17 use Yoast\PHPUnitPolyfills\Polyfills\ExpectPHPException; 18 19 require_once __DIR__ . '/abstract-testcase.php'; 4 20 5 21 /** … … 14 30 class WP_UnitTestCase extends WP_UnitTestCase_Base { 15 31 32 use AssertAttributeHelper; 33 use AssertClosedResource; 34 use AssertEqualsSpecializations; 35 use AssertFileDirectory; 36 use AssertFileEqualsSpecializations; 37 use AssertionRenames; 38 use AssertIsType; 39 use AssertNumericType; 40 use AssertObjectEquals; 41 use AssertStringContains; 42 use EqualToSpecializations; 43 use ExpectException; 44 use ExpectExceptionMessageMatches; 45 use ExpectExceptionObject; 46 use ExpectPHPException; 47 16 48 /** 17 * Asserts that a condition is not false. 18 * 19 * This method has been backported from a more recent PHPUnit version, as tests running on PHP 5.2 use 20 * PHPUnit 3.6.x. 21 * 22 * @since 4.7.4 23 * 24 * @param bool $condition Condition to check. 25 * @param string $message Optional. Message to display when the assertion fails. 26 * 27 * @throws PHPUnit_Framework_AssertionFailedError 49 * Wrapper method for the `setUpBeforeClass()` method for forward-compatibility with WP 5.9. 28 50 */ 29 public static function assertNotFalse( $condition, $message = '' ) { 30 self::assertThat( $condition, self::logicalNot( self::isFalse() ), $message ); 51 public static function set_up_before_class() { 52 static::setUpBeforeClass(); 53 } 54 55 /** 56 * Wrapper method for the `tearDownAfterClass()` method for forward-compatibility with WP 5.9. 57 */ 58 public static function tear_down_after_class() { 59 static::tearDownAfterClass(); 60 } 61 62 /** 63 * Wrapper method for the `setUp()` method for forward-compatibility with WP 5.9. 64 */ 65 public function set_up() { 66 static::setUp(); 67 } 68 69 /** 70 * Wrapper method for the `tearDown()` method for forward-compatibility with WP 5.9. 71 */ 72 public function tear_down() { 73 static::tearDown(); 31 74 } 32 75 }
Note: See TracChangeset
for help on using the changeset viewer.