mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 23:58:03 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@29932 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -106,7 +106,9 @@ class Tests_Canonical extends WP_UnitTestCase {
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
function test($test_url, $expected, $ticket = 0) {
|
||||
function test( $test_url, $expected, $ticket = 0, $expected_doing_it_wrong = array() ) {
|
||||
$this->expected_doing_it_wrong = array_merge( $this->expected_doing_it_wrong, (array) $expected_doing_it_wrong );
|
||||
|
||||
if ( $ticket )
|
||||
$this->knownWPBug( $ticket );
|
||||
|
||||
@@ -246,7 +248,7 @@ class Tests_Canonical extends WP_UnitTestCase {
|
||||
array( '/?year=2008', '/2008/'),
|
||||
|
||||
array( '/2012/13/', '/2012/'),
|
||||
array( '/2012/11/51/', '/2012/11/'),
|
||||
array( '/2012/11/51/', '/2012/11/', 0, array( 'WP_Date_Query' ) ),
|
||||
|
||||
// Authors
|
||||
array( '/?author=%d', '/author/canonical-author/' ),
|
||||
|
||||
Reference in New Issue
Block a user