Make WordPress Core


Ignore:
Timestamp:
10/18/2023 10:39:19 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Tests: Remove some unnecessary function_exists() checks for compat functions.

Each of these functions already has a separate test for availability.

If any of them are unavailable, then the test should fail rather than be skipped.

Follow-up to [52038], [52039], [52040].

Props johnbillion.
See #59647.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/compat/arrayKeyFirst.php

    r56548 r56969  
    2525         */
    2626        public function test_array_key_first( $expected, $arr ) {
    27                 if ( ! function_exists( 'array_key_first' ) ) {
    28                         $this->markTestSkipped( 'array_key_first() is not available.' );
    29                 } else {
    30                         $this->assertSame(
    31                                 $expected,
    32                                 array_key_first( $arr )
    33                         );
    34                 }
     27                $this->assertSame( $expected, array_key_first( $arr ) );
    3528        }
    3629
Note: See TracChangeset for help on using the changeset viewer.