Changeset 44959 for trunk/tests/phpunit/tests/admin/includesPost.php
- Timestamp:
- 03/21/2019 12:43:48 PM (7 years 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
r44672 r44959 852 852 $this->assertEquals( '', get_post_meta( $p, 'testkey', true ) ); 853 853 } 854 855 /** 856 * Test the post type support in post_exists(). 857 * 858 * @ticket 37406 859 */ 860 public function test_post_exists_should_support_post_type() { 861 $title = 'Foo Bar'; 862 $post_type = 'page'; 863 $post_id = self::factory()->post->create( 864 array( 865 'post_title' => $title, 866 'post_type' => $post_type, 867 ) 868 ); 869 $this->assertSame( $post_id, post_exists( $title, null, null, $post_type ) ); 870 } 871 872 /** 873 * Test that post_exists() doesn't find an existing page as a post. 874 * 875 * @ticket 37406 876 */ 877 public function test_post_exists_should_not_match_a_page_for_post() { 878 $title = 'Foo Bar'; 879 $post_type = 'page'; 880 $post_id = self::factory()->post->create( 881 array( 882 'post_title' => $title, 883 'post_type' => $post_type, 884 ) 885 ); 886 $this->assertSame( 0, post_exists( $title, null, null, 'post' ) ); 887 } 854 888 }
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)