From 7505593ab86dae3bbaa6e507ba232c96af832d53 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Mon, 29 Feb 2016 21:55:41 +0000 Subject: [PATCH] Tests: `setExpectedDeprecated` and `setExpectedIncorrectUsage` tests should make assertions. Introduced in [31306]. See #36016. git-svn-id: https://develop.svn.wordpress.org/trunk@36785 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/includes/helpers.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/includes/helpers.php b/tests/phpunit/tests/includes/helpers.php index b717fdcb1a..64cb633a42 100644 --- a/tests/phpunit/tests/includes/helpers.php +++ b/tests/phpunit/tests/includes/helpers.php @@ -174,7 +174,7 @@ class Tests_TestHelpers extends WP_UnitTestCase { */ public function test_setExpectedDeprecated() { $this->setExpectedDeprecated( 'Tests_TestHelpers::mock_deprecated' ); - $this->mock_deprecated(); + $this->assertTrue( $this->mock_deprecated() ); } /** @@ -182,7 +182,7 @@ class Tests_TestHelpers extends WP_UnitTestCase { */ public function test_setExpectedIncorrectUsage() { $this->setExpectedIncorrectUsage( 'Tests_TestHelpers::mock_incorrect_usage' ); - $this->mock_incorrect_usage(); + $this->assertTrue( $this->mock_incorrect_usage() ); } /** @@ -197,9 +197,11 @@ class Tests_TestHelpers extends WP_UnitTestCase { protected function mock_deprecated() { _deprecated_function( __METHOD__, '2.5' ); + return true; } protected function mock_incorrect_usage() { _doing_it_wrong( __METHOD__, __( 'Incorrect usage test' ), '2.5' ); + return true; } }