From 4b8e33fbee15be9a0cd06bea00df765636e812ae Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 30 Jan 2019 14:30:42 +0000 Subject: [PATCH] Build/Test Tools: Move `WP_UnitTestCase_Base::assertPostConditions()` to a more appropriate place. See #43218. git-svn-id: https://develop.svn.wordpress.org/trunk@44719 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/includes/abstract-testcase.php | 22 ++++++++++---------- tests/phpunit/includes/phpunit7/testcase.php | 1 + 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/tests/phpunit/includes/abstract-testcase.php b/tests/phpunit/includes/abstract-testcase.php index e84f80d1c3..c90a1614e8 100644 --- a/tests/phpunit/includes/abstract-testcase.php +++ b/tests/phpunit/includes/abstract-testcase.php @@ -136,17 +136,6 @@ abstract class WP_UnitTestCase_Base extends PHPUnit_Framework_TestCase { add_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) ); } - /** - * Detect post-test failure conditions. - * - * We use this method to detect expectedDeprecated and expectedIncorrectUsage annotations. - * - * @since 4.2.0 - */ - protected function assertPostConditions() { - $this->expectedDeprecated(); - } - /** * After a test method runs, reset any state in WordPress the test method might have changed. */ @@ -448,6 +437,17 @@ abstract class WP_UnitTestCase_Base extends PHPUnit_Framework_TestCase { } } + /** + * Detect post-test failure conditions. + * + * We use this method to detect expectedDeprecated and expectedIncorrectUsage annotations. + * + * @since 4.2.0 + */ + protected function assertPostConditions() { + $this->expectedDeprecated(); + } + /** * Declare an expected `_deprecated_function()` or `_deprecated_argument()` call from within a test. * diff --git a/tests/phpunit/includes/phpunit7/testcase.php b/tests/phpunit/includes/phpunit7/testcase.php index 325c553eed..9edc885e6a 100644 --- a/tests/phpunit/includes/phpunit7/testcase.php +++ b/tests/phpunit/includes/phpunit7/testcase.php @@ -12,6 +12,7 @@ require_once dirname( dirname( __FILE__ ) ) . '/abstract-testcase.php'; * All WordPress unit tests should inherit from this class. */ class WP_UnitTestCase extends WP_UnitTestCase_Base { + /** * Asserts that a condition is not false. *