Make WordPress Core


Ignore:
Timestamp:
10/18/2023 10:39:19 AM (2 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/strContains.php

    r56548 r56969  
    2727     */
    2828    public function test_str_contains( $expected, $haystack, $needle ) {
    29         if ( ! function_exists( 'str_contains' ) ) {
    30             $this->markTestSkipped( 'str_contains() is not available.' );
    31         } else {
    32             $this->assertSame(
    33                 $expected,
    34                 str_contains( $haystack, $needle )
    35             );
    36         }
     29        $this->assertSame( $expected, str_contains( $haystack, $needle ) );
    3730    }
    3831
Note: See TracChangeset for help on using the changeset viewer.