Make WordPress Core


Ignore:
Timestamp:
05/26/2025 12:03:18 PM (13 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/feed/atom.php

    r56549 r60251  
    280280        $entries = array_slice( $entries, 0, 1 );
    281281
     282        $this->assertNotEmpty( $entries );
     283
    282284        foreach ( $entries as $key => $entry ) {
    283285            $links = xml_find( $entries[ $key ]['child'], 'link' );
Note: See TracChangeset for help on using the changeset viewer.