From aadc1d70f27b91a9331009a09460c1eb912bec5d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 16 Sep 2020 01:33:42 +0000 Subject: [PATCH] Tests: Revert [48973]. These tests ensure that a `_doing_it_wrong()` notice is thrown when `wpdb::prepare()` is called incorrectly, but also that the function will still handle the provided input as correctly as possible. Disabling these tests on PHP 8 hides a problem, i.e. the function will no longer throw a notice and handle things correctly, it will now cause a white screen of death due to a fatal error. That is a backward compatibility break, and `wpdb::prepare()` should be updated instead to maintain the original behaviour on PHP 8. Props jrf, ayeshrajans. See #50913, #50639. git-svn-id: https://develop.svn.wordpress.org/trunk@48979 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/db.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/phpunit/tests/db.php b/tests/phpunit/tests/db.php index 206d1f196b..718474455a 100644 --- a/tests/phpunit/tests/db.php +++ b/tests/phpunit/tests/db.php @@ -379,7 +379,6 @@ class Tests_DB extends WP_UnitTestCase { /** * @expectedIncorrectUsage wpdb::prepare - * @requires PHP < 8.0 */ function test_prepare_sprintf_invalid_args() { global $wpdb; @@ -402,7 +401,6 @@ class Tests_DB extends WP_UnitTestCase { /** * @expectedIncorrectUsage wpdb::prepare - * @requires PHP < 8.0 */ function test_prepare_vsprintf_invalid_args() { global $wpdb; @@ -420,7 +418,6 @@ class Tests_DB extends WP_UnitTestCase { * @ticket 42040 * @dataProvider data_prepare_incorrect_arg_count * @expectedIncorrectUsage wpdb::prepare - * @requires PHP < 8.0 */ public function test_prepare_incorrect_arg_count( $query, $args, $expected ) { global $wpdb;