Changeset 53788
- Timestamp:
- 07/27/2022 04:07:20 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/wpInsertPost.php
r53787 r53788 689 689 array( 690 690 'post_status' => 'publish', 691 'post_content' => 'content',692 'post_title' => 'title',693 691 ) 694 692 ); … … 706 704 array( 707 705 'post_status' => 'publish', 708 'post_content' => 'content',709 'post_title' => 'title',710 706 'post_type' => 'page', 711 707 ) … … 721 717 */ 722 718 public function test_wp_insert_post_cpt_default_comment_ping_status_open() { 723 $post_type = rand_str( 20 ); 724 register_post_type( $post_type, array( 'supports' => array( 'comments', 'trackbacks' ) ) ); 725 726 $post_id = self::factory()->post->create( 727 array( 728 'post_status' => 'publish', 729 'post_content' => rand_str(), 730 'post_title' => rand_str(), 731 'post_type' => $post_type, 719 register_post_type( 720 'cpt', 721 array( 722 'supports' => array( 'comments', 'trackbacks' ), 723 ) 724 ); 725 726 $post_id = self::factory()->post->create( 727 array( 728 'post_status' => 'publish', 729 'post_type' => 'cpt', 732 730 ) 733 731 ); 734 732 $post = get_post( $post_id ); 735 733 736 _unregister_post_type( $post_type);734 _unregister_post_type( 'cpt' ); 737 735 738 736 $this->assertSame( 'open', $post->comment_status ); … … 744 742 */ 745 743 public function test_wp_insert_post_cpt_default_comment_ping_status_closed() { 746 $post_type = rand_str( 20 ); 747 register_post_type( $post_type ); 748 749 $post_id = self::factory()->post->create( 750 array( 751 'post_status' => 'publish', 752 'post_content' => rand_str(), 753 'post_title' => rand_str(), 754 'post_type' => $post_type, 744 register_post_type( 'cpt' ); 745 746 $post_id = self::factory()->post->create( 747 array( 748 'post_status' => 'publish', 749 'post_type' => 'cpt', 755 750 ) 756 751 ); 757 752 $post = get_post( $post_id ); 758 753 759 _unregister_post_type( $post_type);754 _unregister_post_type( 'cpt' ); 760 755 761 756 $this->assertSame( 'closed', $post->comment_status );
Note: See TracChangeset
for help on using the changeset viewer.