mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Tests: Correct data providers for get_term_link() and get_edit_term_link() tests.
* The tests use named data providers which include a flag for passing either a term ID or term object to the test, but the values for the flag were the opposite of what the array key says. * Some array keys were duplicated, which means the earlier test case with the same name did not actually run. Follow-up to [52180], [52255], [52258], [52305]. See #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@53833 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -118,34 +118,34 @@ class Tests_Link_EditTermLink extends WP_UnitTestCase {
|
||||
*/
|
||||
public function data_edit_term_link() {
|
||||
return array(
|
||||
'category passing term_id' => array(
|
||||
'taxonomy' => 'category',
|
||||
'use_id' => false,
|
||||
'expected' => 'term.php?taxonomy=category&tag_ID=%ID%&post_type=post',
|
||||
),
|
||||
'category passing term object' => array(
|
||||
'category passing term_id' => array(
|
||||
'taxonomy' => 'category',
|
||||
'use_id' => true,
|
||||
'expected' => 'term.php?taxonomy=category&tag_ID=%ID%&post_type=post',
|
||||
),
|
||||
'post_tag passing term_id' => array(
|
||||
'taxonomy' => 'post_tag',
|
||||
'category passing term object' => array(
|
||||
'taxonomy' => 'category',
|
||||
'use_id' => false,
|
||||
'expected' => 'term.php?taxonomy=post_tag&tag_ID=%ID%&post_type=post',
|
||||
'expected' => 'term.php?taxonomy=category&tag_ID=%ID%&post_type=post',
|
||||
),
|
||||
'post_tag passing term object' => array(
|
||||
'post_tag passing term_id' => array(
|
||||
'taxonomy' => 'post_tag',
|
||||
'use_id' => true,
|
||||
'expected' => 'term.php?taxonomy=post_tag&tag_ID=%ID%&post_type=post',
|
||||
),
|
||||
'a custom taxonomy passing term_id' => array(
|
||||
'post_tag passing term object' => array(
|
||||
'taxonomy' => 'post_tag',
|
||||
'use_id' => false,
|
||||
'expected' => 'term.php?taxonomy=post_tag&tag_ID=%ID%&post_type=post',
|
||||
),
|
||||
'a custom taxonomy passing term_id' => array(
|
||||
'taxonomy' => 'custom_taxonomy',
|
||||
'use_id' => false,
|
||||
'use_id' => true,
|
||||
'expected' => 'term.php?taxonomy=custom_taxonomy&tag_ID=%ID%&post_type=post',
|
||||
),
|
||||
'a custom taxonomy passing term_id' => array(
|
||||
'a custom taxonomy passing term object' => array(
|
||||
'taxonomy' => 'custom_taxonomy',
|
||||
'use_id' => true,
|
||||
'use_id' => false,
|
||||
'expected' => 'term.php?taxonomy=custom_taxonomy&tag_ID=%ID%&post_type=post',
|
||||
),
|
||||
);
|
||||
|
||||
@@ -118,34 +118,34 @@ class Tests_Link_GetEditTermLink extends WP_UnitTestCase {
|
||||
*/
|
||||
public function data_get_edit_term_link() {
|
||||
return array(
|
||||
'category passing term_id' => array(
|
||||
'taxonomy' => 'category',
|
||||
'use_id' => false,
|
||||
'expected' => 'term.php?taxonomy=category&tag_ID=%ID%&post_type=post',
|
||||
),
|
||||
'category passing term object' => array(
|
||||
'category passing term_id' => array(
|
||||
'taxonomy' => 'category',
|
||||
'use_id' => true,
|
||||
'expected' => 'term.php?taxonomy=category&tag_ID=%ID%&post_type=post',
|
||||
),
|
||||
'post_tag passing term_id' => array(
|
||||
'taxonomy' => 'post_tag',
|
||||
'category passing term object' => array(
|
||||
'taxonomy' => 'category',
|
||||
'use_id' => false,
|
||||
'expected' => 'term.php?taxonomy=post_tag&tag_ID=%ID%&post_type=post',
|
||||
'expected' => 'term.php?taxonomy=category&tag_ID=%ID%&post_type=post',
|
||||
),
|
||||
'post_tag passing term object' => array(
|
||||
'post_tag passing term_id' => array(
|
||||
'taxonomy' => 'post_tag',
|
||||
'use_id' => true,
|
||||
'expected' => 'term.php?taxonomy=post_tag&tag_ID=%ID%&post_type=post',
|
||||
),
|
||||
'a custom taxonomy passing term_id' => array(
|
||||
'post_tag passing term object' => array(
|
||||
'taxonomy' => 'post_tag',
|
||||
'use_id' => false,
|
||||
'expected' => 'term.php?taxonomy=post_tag&tag_ID=%ID%&post_type=post',
|
||||
),
|
||||
'a custom taxonomy passing term_id' => array(
|
||||
'taxonomy' => 'custom_taxonomy',
|
||||
'use_id' => false,
|
||||
'use_id' => true,
|
||||
'expected' => 'term.php?taxonomy=custom_taxonomy&tag_ID=%ID%&post_type=post',
|
||||
),
|
||||
'a custom taxonomy passing term_id' => array(
|
||||
'a custom taxonomy passing term object' => array(
|
||||
'taxonomy' => 'custom_taxonomy',
|
||||
'use_id' => true,
|
||||
'use_id' => false,
|
||||
'expected' => 'term.php?taxonomy=custom_taxonomy&tag_ID=%ID%&post_type=post',
|
||||
),
|
||||
);
|
||||
|
||||
@@ -294,30 +294,29 @@ class Tests_Term_GetTermLink extends WP_UnitTestCase {
|
||||
*/
|
||||
public function data_get_term_link() {
|
||||
return array(
|
||||
'category passing term_id' => array(
|
||||
'taxonomy' => 'category',
|
||||
'use_id' => false,
|
||||
),
|
||||
'category passing term object' => array(
|
||||
'category passing term_id' => array(
|
||||
'taxonomy' => 'category',
|
||||
'use_id' => true,
|
||||
),
|
||||
'post_tag passing term_id' => array(
|
||||
'taxonomy' => 'post_tag',
|
||||
'category passing term object' => array(
|
||||
'taxonomy' => 'category',
|
||||
'use_id' => false,
|
||||
),
|
||||
'post_tag passing term object' => array(
|
||||
'post_tag passing term_id' => array(
|
||||
'taxonomy' => 'post_tag',
|
||||
'use_id' => true,
|
||||
),
|
||||
'a custom taxonomy passing term_id' => array(
|
||||
'taxonomy' => 'wptests_tax',
|
||||
'post_tag passing term object' => array(
|
||||
'taxonomy' => 'post_tag',
|
||||
'use_id' => false,
|
||||
),
|
||||
'a custom taxonomy passing term_id' => array(
|
||||
'a custom taxonomy passing term_id' => array(
|
||||
'taxonomy' => 'wptests_tax',
|
||||
'use_id' => true,
|
||||
'expected' => 'term.php?taxonomy=custom_taxonomy&tag_ID=%ID%&post_type=post',
|
||||
),
|
||||
'a custom taxonomy passing term object' => array(
|
||||
'taxonomy' => 'wptests_tax',
|
||||
'use_id' => false,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user