Make WordPress Core


Ignore:
Timestamp:
05/26/2025 12:03:18 PM (9 months ago)
Author:
johnbillion
Message:

Build/Test Tools: Add assertions that test the tests.

Several tests perform assertions conditionally or iterate dynamic arrays without ensuring they're populated. If the test is faulty and the condition never evaluates to true, or the array being iterated is unexpectedly empty, this will now correctly cause the test to fail.

Props johnbillion, jrf.

See #63167

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/shortcode.php

    r57597 r60251  
    694694        add_shortcode( $input, '' );
    695695        $actual = shortcode_exists( $input );
    696         $this->assertSame( $expected, $actual );
    697696        if ( $actual ) {
    698697            remove_shortcode( $input );
    699698        }
     699
     700        $this->assertSame( $expected, $actual );
    700701    }
    701702
Note: See TracChangeset for help on using the changeset viewer.