From e3a9d870834f6fff9c59efb48c31fe3feb306681 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sun, 23 Apr 2017 21:34:37 +0000 Subject: [PATCH] Build/Test Tools: More tweaks to the deprecated calls assertion. This needs to be triggered when there are unexpected deprecated calls or wrongdoings too. See #40538 git-svn-id: https://develop.svn.wordpress.org/trunk@40542 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/includes/testcase.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/includes/testcase.php b/tests/phpunit/includes/testcase.php index 45fcdebcd7..0f2bf7423f 100644 --- a/tests/phpunit/includes/testcase.php +++ b/tests/phpunit/includes/testcase.php @@ -388,8 +388,11 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase { $errors[] = "Unexpected incorrect usage notice for $unexpected"; } - // 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 ) ) { + // Perform an assertion, but only if there are expected or unexpected deprecated calls or wrongdoings + if ( ! empty( $this->expected_deprecated ) || + ! empty( $this->expected_doing_it_wrong ) || + ! empty( $this->caught_deprecated ) || + ! empty( $this->caught_doing_it_wrong ) ) { $this->assertEmpty( $errors, implode( "\n", $errors ) ); } }