Make WordPress Core


Ignore:
Timestamp:
10/17/2014 12:40:06 AM (11 years ago)
Author:
boonebgorges
Message:

Add expectedIncorrectUsage flags for unit tests that generate invalid dates.

Since [29925], passing an invalid date to WP_Date_Query will generate a
_doing_it_wrong() notice. The current changeset adds the
@expectedIncorrectUsage flag to those existing unit tests that generate
invalid dates, such as those that test canonical redirect and is_404()
conditionals.

Fixes #25834.

File:
1 edited

Legend:

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

    r28966 r29932  
    107107     * @dataProvider data
    108108     */
    109     function test($test_url, $expected, $ticket = 0) {
     109    function test( $test_url, $expected, $ticket = 0, $expected_doing_it_wrong = array() ) {
     110        $this->expected_doing_it_wrong = array_merge( $this->expected_doing_it_wrong, (array) $expected_doing_it_wrong );
     111
    110112        if ( $ticket )
    111113            $this->knownWPBug( $ticket );
     
    247249
    248250            array( '/2012/13/', '/2012/'),
    249             array( '/2012/11/51/', '/2012/11/'),
     251            array( '/2012/11/51/', '/2012/11/', 0, array( 'WP_Date_Query' ) ),
    250252
    251253            // Authors
Note: See TracChangeset for help on using the changeset viewer.