Changeset 61360 for trunk/tests/phpunit/tests/admin/includesPost.php
- Timestamp:
- 12/08/2025 09:53:05 PM (9 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/admin/includesPost.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/includesPost.php
r60701 r61360 547 547 $this->expectException( 'WPDieException' ); 548 548 get_default_post_to_edit( 'post', true ); 549 } 550 551 /** 552 * Tests that default post title is present when a CPT has title support, and is empty otherwise. 553 * 554 * @ticket 45516 555 * 556 * @covers ::get_default_post_to_edit 557 */ 558 public function test_get_default_post_to_edit_with_and_without_title_support() { 559 register_post_type( 560 'yes_title', 561 array( 562 'supports' => array( 'title', 'editor' ), 563 ) 564 ); 565 register_post_type( 566 'no_title', 567 array( 568 'supports' => array( 'editor' ), 569 ) 570 ); 571 572 /* 573 * The ID is obtained because get_default_post_to_edit() will force the post_title 574 * to be overridden on the returned WP_Post object. 575 */ 576 $default_yes_title_post_id = get_default_post_to_edit( 'yes_title', true )->ID; 577 $default_no_title_post_id = get_default_post_to_edit( 'no_title', true )->ID; 578 579 $this->assertSame( __( 'Auto Draft' ), get_post( $default_yes_title_post_id )->post_title, 'Expected post_title to be the default title.' ); 580 $this->assertSame( '', get_post( $default_no_title_post_id )->post_title, 'Expected post_title to be an empty string.' ); 549 581 } 550 582
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)