Make WordPress Core

Ticket #37406: 37406.2.patch

File 37406.2.patch, 725 bytes (added by birgire, 7 years ago)
  • tests/phpunit/tests/admin/includesPost.php

    diff --git tests/phpunit/tests/admin/includesPost.php tests/phpunit/tests/admin/includesPost.php
    index f2df065..f9a9fbc 100644
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    658658                $this->assertSame( $p, post_exists( $title, $content, $date ) );
    659659        }
    660660
     661        /**
     662         * @ticket 37406
     663         */
     664        public function test_post_exists_should_support_post_type() {
     665                $title = 'Foo Bar';
     666                $post_type = 'page';
     667                $post_id = self::factory()->post->create( array(
     668                        'post_title'    => $title,
     669                        'post_type'     => $post_type,
     670                ) );
     671
     672                $this->assertSame( $post_id, post_exists( $title, null, null, $post_type ) );
     673        }
    661674}