Changeset 53371 for trunk/tests/phpunit/tests/taxonomy.php
- Timestamp:
- 05/09/2022 05:56:36 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/taxonomy.php
r53368 r53371 222 222 } 223 223 224 225 224 /** 226 225 * @ticket 53212 … … 237 236 238 237 $this->assertSame( 3, $action->get_call_count() ); 239 }240 241 /**242 * @ticket 49701243 *244 * @covers ::get_inline_data245 */246 public function test_get_inline_data_contains_term_if_show_ui_false_but_show_on_quick_edit_true_for_hierarchical_taxonomy() {247 // Create a post with a term from a hierarchical taxonomy.248 register_taxonomy(249 'wptests_tax_1',250 'post',251 array(252 'show_ui' => false,253 'show_in_quick_edit' => true,254 'hierarchical' => true,255 )256 );257 $term = wp_insert_term( 'Test', 'wptests_tax_1' );258 $post = self::factory()->post->create_and_get();259 wp_set_object_terms( $post->ID, $term['term_id'], 'wptests_tax_1' );260 261 // Test get_inline_data() has post_category div containing assigned term.262 wp_set_current_user( self::factory()->user->create( array( 'role' => 'editor' ) ) );263 get_inline_data( $post );264 $this->expectOutputRegex( '/<div class="post_category" id="wptests_tax_1_' . $post->ID . '">' . $term['term_id'] . '<\/div>/' );265 }266 267 /**268 * @ticket 49701269 *270 * @covers ::get_inline_data271 */272 public function test_get_inline_data_contains_term_if_show_ui_false_but_show_on_quick_edit_true_for_nonhierarchical_taxonomy() {273 // Create a post with a term from a hierarchical taxonomy.274 register_taxonomy(275 'wptests_tax_1',276 'post',277 array(278 'show_ui' => false,279 'show_in_quick_edit' => true,280 'hierarchical' => false,281 )282 );283 $term = wp_insert_term( 'Test', 'wptests_tax_1' );284 $post = self::factory()->post->create_and_get();285 wp_set_object_terms( $post->ID, $term['term_id'], 'wptests_tax_1' );286 287 // Test get_inline_data() has tags_input div containing assigned term.288 wp_set_current_user( self::factory()->user->create( array( 'role' => 'editor' ) ) );289 get_inline_data( $post );290 $this->expectOutputRegex( '/<div class="tags_input" id="wptests_tax_1_' . $post->ID . '">Test<\/div>/' );291 238 } 292 239
Note: See TracChangeset
for help on using the changeset viewer.