Make WordPress Core

Changeset 57011


Ignore:
Timestamp:
10/26/2023 08:31:45 PM (6 months ago)
Author:
SergeyBiryukov
Message:

Tests: Use a @requires annotation for readonly() function test.

The function is only defined by WordPress core on PHP < 8.1.

Follow-up to [51586].

See #59647.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/php-compat/readonly.php

    r54951 r57011  
    55 *
    66 * In order to avoid PHP parser errors, this function was extracted
    7  * to this separate file and is only included conditionally on PHP 8.1.
     7 * to this separate file and is only included conditionally on PHP < 8.1.
    88 *
    99 * Including this file on PHP >= 8.1 results in a fatal error.
  • trunk/tests/phpunit/tests/general/template_CheckedSelectedHelper.php

    r51586 r57011  
    5757     * @ticket 53858
    5858     * @covers ::readonly
     59     * @requires PHP < 8.1
    5960     */
    6061    public function test_readonly_with_equal_values() {
    61         if ( ! function_exists( 'readonly' ) ) {
    62             $this->markTestSkipped( 'readonly() function is not available on PHP 8.1' );
    63         }
    64 
    6562        $this->setExpectedDeprecated( 'readonly' );
    6663
Note: See TracChangeset for help on using the changeset viewer.