WordPress.org

Make WordPress Core

Changeset 48973


Ignore:
Timestamp:
09/13/2020 02:47:20 AM (3 months ago)
Author:
SergeyBiryukov
Message:

Tests: Require PHP less than 8.0 for some wpdb tests.

These tests ensure that wpdb::prepare() throws a _doing_it_wrong() notice when called with an incorrect number of arguments, or with arguments of a wrong type.

PHP 8 introduces similar error messages natively, making these tests redundant on PHP 8.0 or later.

Follow-up to [41470], [41662].

See #50913.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/db.php

    r48939 r48973  
    380380    /**
    381381     * @expectedIncorrectUsage wpdb::prepare
     382     * @requires PHP < 8.0
    382383     */
    383384    function test_prepare_sprintf_invalid_args() {
     
    402403    /**
    403404     * @expectedIncorrectUsage wpdb::prepare
     405     * @requires PHP < 8.0
    404406     */
    405407    function test_prepare_vsprintf_invalid_args() {
     
    419421     * @dataProvider data_prepare_incorrect_arg_count
    420422     * @expectedIncorrectUsage wpdb::prepare
     423     * @requires PHP < 8.0
    421424     */
    422425    public function test_prepare_incorrect_arg_count( $query, $args, $expected ) {
Note: See TracChangeset for help on using the changeset viewer.