Changeset 35242 for trunk/tests/phpunit/tests/category/wpListCategories.php
- Timestamp:
- 10/17/2015 06:02:16 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/category/wpListCategories.php
r35225 r35242 6 6 class Tests_Category_WpListCategories extends WP_UnitTestCase { 7 7 public function test_class() { 8 $c = self:: $factory->category->create();8 $c = self::factory()->category->create(); 9 9 10 10 $found = wp_list_categories( array( … … 17 17 18 18 public function test_class_containing_current_cat() { 19 $c1 = self:: $factory->category->create();20 $c2 = self:: $factory->category->create();19 $c1 = self::factory()->category->create(); 20 $c2 = self::factory()->category->create(); 21 21 22 22 $found = wp_list_categories( array( … … 31 31 32 32 public function test_class_containing_current_cat_parent() { 33 $c1 = self:: $factory->category->create();34 $c2 = self:: $factory->category->create( array(33 $c1 = self::factory()->category->create(); 34 $c2 = self::factory()->category->create( array( 35 35 'parent' => $c1, 36 36 ) ); … … 50 50 */ 51 51 public function test_current_category_should_accept_an_array_of_ids() { 52 $cats = self:: $factory->category->create_many( 3 );52 $cats = self::factory()->category->create_many( 3 ); 53 53 54 54 $found = wp_list_categories( array( … … 67 67 */ 68 68 public function test_should_not_create_element_when_cat_name_is_filtered_to_empty_string() { 69 $c1 = self:: $factory->category->create( array(69 $c1 = self::factory()->category->create( array( 70 70 'name' => 'Test Cat 1', 71 71 ) ); 72 $c2 = self:: $factory->category->create( array(72 $c2 = self::factory()->category->create( array( 73 73 'name' => 'Test Cat 2', 74 74 ) ); … … 89 89 90 90 public function test_show_option_all_link_should_go_to_home_page_when_show_on_front_is_false() { 91 $cats = self:: $factory->category->create_many( 2 );91 $cats = self::factory()->category->create_many( 2 ); 92 92 93 93 $found = wp_list_categories( array( … … 102 102 103 103 public function test_show_option_all_link_should_respect_page_for_posts() { 104 $cats = self:: $factory->category->create_many( 2 );105 $p = self:: $factory->post->create( array( 'post_type' => 'page' ) );104 $cats = self::factory()->category->create_many( 2 ); 105 $p = self::factory()->post->create( array( 'post_type' => 'page' ) ); 106 106 107 107 update_option( 'show_on_front', 'page' ); … … 126 126 register_taxonomy( 'wptests_tax', array( 'foo', 'wptests_pt', 'wptests_pt2' ) ); 127 127 128 $terms = self:: $factory->term->create_many( 2, array(128 $terms = self::factory()->term->create_many( 2, array( 129 129 'taxonomy' => 'wptests_tax', 130 130 ) ); … … 150 150 register_taxonomy( 'wptests_tax', array( 'foo', 'wptests_pt', 'wptests_pt2' ) ); 151 151 152 $terms = self:: $factory->term->create_many( 2, array(152 $terms = self::factory()->term->create_many( 2, array( 153 153 'taxonomy' => 'wptests_tax', 154 154 ) ); … … 171 171 register_taxonomy( 'wptests_tax', array( 'foo', 'wptests_pt', 'post', 'wptests_pt2' ) ); 172 172 173 $terms = self:: $factory->term->create_many( 2, array(173 $terms = self::factory()->term->create_many( 2, array( 174 174 'taxonomy' => 'wptests_tax', 175 175 ) ); … … 192 192 register_taxonomy( 'wptests_tax', array( 'foo', 'wptests_pt', 'wptests_pt2' ) ); 193 193 194 $terms = self:: $factory->term->create_many( 2, array(194 $terms = self::factory()->term->create_many( 2, array( 195 195 'taxonomy' => 'wptests_tax', 196 196 ) ); … … 255 255 */ 256 256 public function test_hide_title_if_empty_should_be_ignored_when_category_list_is_not_empty() { 257 $cat = self:: $factory->category->create();257 $cat = self::factory()->category->create(); 258 258 259 259 $found = wp_list_categories( array( … … 270 270 */ 271 271 public function test_exclude_tree_should_be_respected() { 272 $c = self:: $factory->category->create();273 $parent = self:: $factory->category->create( array( 'name' => 'Parent', 'slug' => 'parent' ) );274 $child = self:: $factory->category->create( array( 'name' => 'Child', 'slug' => 'child', 'parent' => $parent ) );272 $c = self::factory()->category->create(); 273 $parent = self::factory()->category->create( array( 'name' => 'Parent', 'slug' => 'parent' ) ); 274 $child = self::factory()->category->create( array( 'name' => 'Child', 'slug' => 'child', 'parent' => $parent ) ); 275 275 276 276 $args = array( 'echo' => 0, 'hide_empty' => 0, 'exclude_tree' => $parent ); … … 287 287 */ 288 288 public function test_exclude_tree_should_be_merged_with_exclude() { 289 $c = self:: $factory->category->create();290 $parent = self:: $factory->category->create( array( 'name' => 'Parent', 'slug' => 'parent' ) );291 $child = self:: $factory->category->create( array( 'name' => 'Child', 'slug' => 'child', 'parent' => $parent ) );292 $parent2 = self:: $factory->category->create( array( 'name' => 'Parent', 'slug' => 'parent2' ) );293 $child2 = self:: $factory->category->create( array( 'name' => 'Child', 'slug' => 'child2', 'parent' => $parent2 ) );289 $c = self::factory()->category->create(); 290 $parent = self::factory()->category->create( array( 'name' => 'Parent', 'slug' => 'parent' ) ); 291 $child = self::factory()->category->create( array( 'name' => 'Child', 'slug' => 'child', 'parent' => $parent ) ); 292 $parent2 = self::factory()->category->create( array( 'name' => 'Parent', 'slug' => 'parent2' ) ); 293 $child2 = self::factory()->category->create( array( 'name' => 'Child', 'slug' => 'child2', 'parent' => $parent2 ) ); 294 294 295 295 $args = array( 'echo' => 0, 'hide_empty' => 0, 'exclude_tree' => $parent );
Note: See TracChangeset
for help on using the changeset viewer.