Make WordPress Core

Changeset 48953


Ignore:
Timestamp:
09/07/2020 03:26:24 AM (17 months ago)
Author:
SergeyBiryukov
Message:

Tests: Remove the polyfill for assertNotFalse().

assertNotFalse() is available in PHPUnit since version 4.0.

The polyfill was introduced back when WordPress still supported PHP 5.2 and PHPUnit 3.6.x, and is now redundant.

Follow-up to [39919], [45058], [47880].

See #38266.

Location:
trunk/tests/phpunit/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/phpunit7/testcase.php

    r48952 r48953  
    1313 */
    1414class WP_UnitTestCase extends WP_UnitTestCase_Base {
    15 
    16     /**
    17      * Asserts that a condition is not false.
    18      *
    19      * This method has been backported from a more recent PHPUnit version,
    20      * as tests running on PHP 5.2 use 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
    28      */
    29     public static function assertNotFalse( $condition, string $message = '' ): void {
    30         self::assertThat( $condition, self::logicalNot( self::isFalse() ), $message );
    31     }
    3215
    3316    /**
  • trunk/tests/phpunit/includes/testcase.php

    r48952 r48953  
    1313 */
    1414class WP_UnitTestCase extends WP_UnitTestCase_Base {
    15 
    16     /**
    17      * Asserts that a condition is not false.
    18      *
    19      * This method has been backported from a more recent PHPUnit version,
    20      * as tests running on PHP 5.2 use 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
    28      */
    29     public static function assertNotFalse( $condition, $message = '' ) {
    30         self::assertThat( $condition, self::logicalNot( self::isFalse() ), $message );
    31     }
    3215
    3316    /**
Note: See TracChangeset for help on using the changeset viewer.