Make WordPress Core

Ticket #37519: 37519-tests.diff

File 37519-tests.diff, 810 bytes (added by iandunn, 8 years ago)
  • tests/phpunit/tests/post/output.php

    diff --git tests/phpunit/tests/post/output.php tests/phpunit/tests/post/output.php
    index 6026a2b..fb60157 100644
    EOF; 
    211211
    212212        /**
    213213         * @ticket 27246
     214         * @ticket 37519
    214215         */
    215216        public function test_the_excerpt_specific_post() {
    216217                $GLOBALS['post'] = self::factory()->post->create_and_get( array( 'post_excerpt' => 'Foo' ) );
     218
     219                // Test with a manually assigned excerpt
    217220                $post_id = self::factory()->post->create( array( 'post_excerpt' => 'Bar' ) );
    218221                $this->assertSame( 'Bar', get_the_excerpt( $post_id ) );
     222
     223                // Test with an automatically generated excerpt
     224                $post_id = self::factory()->post->create( array( 'post_content' => 'Bar' ) );
     225                $this->assertSame( 'Bar', get_the_excerpt( $post_id ) );
    219226        }
    220227}