Make WordPress Core

Changeset 40541


Ignore:
Timestamp:
04/23/2017 09:28:44 PM (7 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Only perform an assertion for deprecated calls and wrongdoings if any are expected.

This avoids masking risky tests that don't otherwise perform an assertion.

See #40538

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/testcase.php

    r40539 r40541  
    389389        }
    390390
    391         $this->assertEmpty( $errors, implode( "\n", $errors ) );
     391        // Perform an assertion, but only if there are expected deprecated calls or expected wrongdoings
     392        if ( ! empty( $this->expected_deprecated ) || ! empty( $this->expected_doing_it_wrong ) ) {
     393            $this->assertEmpty( $errors, implode( "\n", $errors ) );
     394        }
    392395    }
    393396
Note: See TracChangeset for help on using the changeset viewer.