diff --git a/tests/phpunit/includes/testcase.php b/tests/phpunit/includes/testcase.php index 554de7e578..45fcdebcd7 100644 --- a/tests/phpunit/includes/testcase.php +++ b/tests/phpunit/includes/testcase.php @@ -388,7 +388,10 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase { $errors[] = "Unexpected incorrect usage notice for $unexpected"; } - $this->assertEmpty( $errors, implode( "\n", $errors ) ); + // Perform an assertion, but only if there are expected deprecated calls or expected wrongdoings + if ( ! empty( $this->expected_deprecated ) || ! empty( $this->expected_doing_it_wrong ) ) { + $this->assertEmpty( $errors, implode( "\n", $errors ) ); + } } /**