Changeset 35225 for trunk/tests/phpunit/tests/category.php
- Timestamp:
- 10/16/2015 09:04:12 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/category.php
r35162 r35225 22 22 function test_get_all_category_ids() { 23 23 // create categories 24 $this->factory->category->create_many( 2 );24 self::$factory->category->create_many( 2 ); 25 25 26 26 // create new taxonomy to ensure not included … … 39 39 40 40 // create Test Categories 41 $testcat = $this->factory->category->create_and_get(41 $testcat = self::$factory->category->create_and_get( 42 42 array( 43 43 'slug' => 'testcat', … … 45 45 ) 46 46 ); 47 $testcat2 = $this->factory->category->create_and_get(47 $testcat2 = self::$factory->category->create_and_get( 48 48 array( 49 49 'slug' => 'testcat2', … … 74 74 'description' => 'Category Test' 75 75 ); 76 $testcat = $this->factory->category->create_and_get( $testcat_array );76 $testcat = self::$factory->category->create_and_get( $testcat_array ); 77 77 $testcat_array['term_id'] = $testcat->term_id; 78 78 … … 83 83 'parent' => $testcat->term_id 84 84 ); 85 $testcat2 = $this->factory->category->create_and_get( $testcat2_array );85 $testcat2 = self::$factory->category->create_and_get( $testcat2_array ); 86 86 $testcat2_array['term_id'] = $testcat2->term_id; 87 87 … … 146 146 147 147 // create Test Category 148 $testcat = $this->factory->category->create_and_get(148 $testcat = self::$factory->category->create_and_get( 149 149 array( 150 150 'slug' => 'testcat', … … 166 166 167 167 // create Test Category 168 $testcat = $this->factory->category->create_and_get(168 $testcat = self::$factory->category->create_and_get( 169 169 array( 170 170 'slug' => 'testcat', … … 186 186 187 187 // create Test Categories 188 $root_id = $this->factory->category->create(188 $root_id = self::$factory->category->create( 189 189 array( 190 190 'slug' => 'root', 191 191 ) 192 192 ); 193 $root_cat_id = $this->factory->category->create(193 $root_cat_id = self::$factory->category->create( 194 194 array( 195 195 'slug' => 'cat', … … 197 197 ) 198 198 ); 199 $root_cat_cat_id = $this->factory->category->create(199 $root_cat_cat_id = self::$factory->category->create( 200 200 array( 201 201 'slug' => 'cat', //note this is modified on create … … 203 203 ) 204 204 ); 205 $root_path_id = $this->factory->category->create(205 $root_path_id = self::$factory->category->create( 206 206 array( 207 207 'slug' => 'path', … … 209 209 ) 210 210 ); 211 $root_path_cat_id = $this->factory->category->create(211 $root_path_cat_id = self::$factory->category->create( 212 212 array( 213 213 'slug' => 'cat', //note this is modified on create … … 215 215 ) 216 216 ); 217 $root_level_id = $this->factory->category->create(217 $root_level_id = self::$factory->category->create( 218 218 array( 219 219 'slug' => 'level-1', … … 221 221 ) 222 222 ); 223 $root_level_cat_id = $this->factory->category->create(223 $root_level_cat_id = self::$factory->category->create( 224 224 array( 225 225 'slug' => 'cat', //note this is modified on create … … 249 249 public function test_wp_dropdown_categories_value_field_should_default_to_term_id() { 250 250 // Create a test category. 251 $cat_id = $this->factory->category->create( array(251 $cat_id = self::$factory->category->create( array( 252 252 'name' => 'Test Category', 253 253 'slug' => 'test_category', … … 269 269 public function test_wp_dropdown_categories_value_field_term_id() { 270 270 // Create a test category. 271 $cat_id = $this->factory->category->create( array(271 $cat_id = self::$factory->category->create( array( 272 272 'name' => 'Test Category', 273 273 'slug' => 'test_category', … … 290 290 public function test_wp_dropdown_categories_value_field_slug() { 291 291 // Create a test category. 292 $cat_id = $this->factory->category->create( array(292 $cat_id = self::$factory->category->create( array( 293 293 'name' => 'Test Category', 294 294 'slug' => 'test_category', … … 311 311 public function test_wp_dropdown_categories_value_field_should_fall_back_on_term_id_when_an_invalid_value_is_provided() { 312 312 // Create a test category. 313 $cat_id = $this->factory->category->create( array(313 $cat_id = self::$factory->category->create( array( 314 314 'name' => 'Test Category', 315 315 'slug' => 'test_category', … … 331 331 */ 332 332 public function test_wp_dropdown_categories_selected_should_respect_custom_value_field() { 333 $c1 = $this->factory->category->create( array(333 $c1 = self::$factory->category->create( array( 334 334 'name' => 'Test Category 1', 335 335 'slug' => 'test_category_1', 336 336 ) ); 337 337 338 $c2 = $this->factory->category->create( array(338 $c2 = self::$factory->category->create( array( 339 339 'name' => 'Test Category 2', 340 340 'slug' => 'test_category_2', … … 355 355 */ 356 356 public function test_wp_dropdown_categories_show_option_all_should_be_selected_if_no_selected_value_is_explicitly_passed_and_value_field_does_not_have_string_values() { 357 $cats = $this->factory->category->create_many( 3 );357 $cats = self::$factory->category->create_many( 3 ); 358 358 359 359 $found = wp_dropdown_categories( array( … … 376 376 */ 377 377 public function test_wp_dropdown_categories_show_option_all_should_be_selected_if_selected_value_of_0_string_is_explicitly_passed_and_value_field_does_not_have_string_values() { 378 $cats = $this->factory->category->create_many( 3 );378 $cats = self::$factory->category->create_many( 3 ); 379 379 380 380 $found = wp_dropdown_categories( array(
Note: See TracChangeset
for help on using the changeset viewer.