Make WordPress Core

Ticket #24330: 24330-ut.diff

File 24330-ut.diff, 737 bytes (added by ryan, 11 years ago)

Unit tests

  • trunk/tests/post/output.php

     
    170170
    171171                kses_remove_filters();
    172172        }
     173
     174        function test_the_content_with_id() {
     175                $post_content = <<<EOF
     176<i>This is the excerpt.</i>
     177<!--more-->
     178This is the <b>body</b>.
     179EOF;
     180
     181                $post_id = $this->factory->post->create( compact( 'post_content' ) );
     182
     183                $expected = <<<EOF
     184<p><i>This is the excerpt.</i><br />
     185<span id="more-{$post_id}"></span><br />
     186This is the <b>body</b>.</p>
     187EOF;
     188
     189                $this->assertEquals( strip_ws( $expected ), strip_ws( get_echo( 'the_content', array( null, false, $post_id ) ) ) );
     190        }
    173191}