Wordpress/tests/phpunit/tests/query
Boone Gorges 4138275df9 More careful type conversion in WP_Query is_*() methods.
`is_array( 1, '1-foo' )` returns true, which means that `is_page( 1 )`
was returning true when on a page with the slug '1-foo'. We avoid this odd
behavior by casting the queried object ID to a string before testing against
the value passed to the conditional function.

This also helps to avoid a problem where an arbitrary value for `$page` would
cause `is_page( $page )` to return true if the query had been manipulated by
a plugin to show that the current page's ID is 0.

Props boonebgorges, r-a-y, nunomorgadinho, wonderboymusic, clifgriffin.
Fixes #24674.

git-svn-id: https://develop.svn.wordpress.org/trunk@31458 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-14 02:08:46 +00:00
..
conditionals.php More careful type conversion in WP_Query is_*() methods. 2015-02-14 02:08:46 +00:00
date.php Share fixtures across a number of query-related test classes. 2014-11-08 15:29:31 +00:00
dateQuery.php Introduced dayofweek_iso time param for WP_Date_Query. 2014-11-01 03:23:15 +00:00
isTerm.php Improve organiation of tax_query and meta_query unit tests. 2015-01-27 20:03:50 +00:00
metaQuery.php Modify `meta_query orderby syntax to use array keys as clause "handles". 2015-02-05 19:37:47 +00:00
parseQuery.php Check that search value is scalar before parsing. 2014-10-16 03:31:27 +00:00
postStatus.php When querying for a specific post, allow posts with a non-public status to be returned as long as that status is specified. 2015-02-01 20:25:42 +00:00
results.php When using WP_Query's 'fields' => 'ids' (or 'fields' => 'id=>parent'), make sure the returned result is always an array of integers. 2015-02-03 02:28:52 +00:00
search.php Add unit tests for searching by relevance. 2014-03-08 21:26:26 +00:00
setupPostdata.php Use correct notation for global functions in @covers test annotations. 2014-12-19 15:20:41 +00:00
stickies.php Add tests for some of WP_Query's sticky post logic. 2015-02-13 02:24:57 +00:00
taxQuery.php Use field-specific sanitization in WP_Tax_Query::transform_query(). 2015-02-06 02:01:24 +00:00
verboseRewriteRules.php Setup rewrite changes in tests in a predictable fashion. Don't mix method calls with wrapper function calls. 2014-07-03 01:42:57 +00:00