Changeset 42343 for trunk/tests/phpunit/tests/post/types.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/types.php
r41174 r42343 298 298 global $wp; 299 299 300 register_post_type( 'foo', array( 301 'public' => true, 302 'query_var' => 'bar', 303 ) ); 300 register_post_type( 301 'foo', array( 302 'public' => true, 303 'query_var' => 'bar', 304 ) 305 ); 304 306 305 307 $this->assertInternalType( 'int', array_search( 'bar', $wp->public_query_vars ) ); … … 316 318 global $wp_rewrite; 317 319 318 register_post_type( 'foo', array( 319 'public' => true, 320 'query_var' => 'bar', 321 ) ); 320 register_post_type( 321 'foo', array( 322 'public' => true, 323 'query_var' => 'bar', 324 ) 325 ); 322 326 323 327 $count_before = count( $wp_rewrite->rewritereplace ); … … 339 343 global $wp_rewrite; 340 344 341 register_post_type( 'foo', array( 342 'public' => true, 343 'has_archive' => true, 344 ) ); 345 register_post_type( 346 'foo', array( 347 'public' => true, 348 'has_archive' => true, 349 ) 350 ); 345 351 346 352 $this->assertContains( 'index.php?post_type=foo', $wp_rewrite->extra_rules_top ); … … 355 361 global $post_type_meta_caps; 356 362 357 register_post_type( 'foo', array( 358 'public' => true, 359 'capability_type' => 'bar', 360 'map_meta_cap' => true, 361 ) ); 363 register_post_type( 364 'foo', array( 365 'public' => true, 366 'capability_type' => 'bar', 367 'map_meta_cap' => true, 368 ) 369 ); 362 370 363 371 $this->assertSame( 'read_post', $post_type_meta_caps['read_bar'] ); … … 378 386 global $_wp_post_type_features; 379 387 380 register_post_type( 'foo', array( 381 'public' => true, 382 'supports' => array( 'editor', 'author', 'title' ), 383 ) ); 388 register_post_type( 389 'foo', array( 390 'public' => true, 391 'supports' => array( 'editor', 'author', 'title' ), 392 ) 393 ); 384 394 385 395 $this->assertEqualSetsWithIndex( … … 401 411 global $wp_taxonomies; 402 412 403 register_post_type( 'foo', array( 404 'public' => true, 405 'taxonomies' => array( 'category', 'post_tag' ), 406 ) ); 413 register_post_type( 414 'foo', array( 415 'public' => true, 416 'taxonomies' => array( 'category', 'post_tag' ), 417 ) 418 ); 407 419 408 420 $this->assertInternalType( 'int', array_search( 'foo', $wp_taxonomies['category']->object_type, true ) ); … … 420 432 global $wp_filter; 421 433 422 register_post_type( 'foo', array( 423 'public' => true, 424 ) ); 434 register_post_type( 435 'foo', array( 436 'public' => true, 437 ) 438 ); 425 439 426 440 $this->assertArrayHasKey( 'future_foo', $wp_filter ); … … 436 450 global $wp_filter; 437 451 438 register_post_type( 'foo', array( 439 'public' => true, 440 'register_meta_box_cb' => '__return_empty_string', 441 ) ); 452 register_post_type( 453 'foo', array( 454 'public' => true, 455 'register_meta_box_cb' => '__return_empty_string', 456 ) 457 ); 442 458 443 459 $this->assertArrayHasKey( 'add_meta_boxes_foo', $wp_filter ); … … 453 469 global $wp_post_types; 454 470 455 register_post_type( 'foo', array( 456 'public' => true, 457 ) ); 471 register_post_type( 472 'foo', array( 473 'public' => true, 474 ) 475 ); 458 476 459 477 $this->assertInternalType( 'object', $wp_post_types['foo'] ); … … 470 488 */ 471 489 public function test_post_type_does_not_exist_after_unregister_post_type() { 472 register_post_type( 'foo', array( 473 'public' => true, 474 ) ); 490 register_post_type( 491 'foo', array( 492 'public' => true, 493 ) 494 ); 475 495 476 496 $this->assertTrue( unregister_post_type( 'foo' ) );
Note: See TracChangeset
for help on using the changeset viewer.