Changeset 38679 for trunk/tests/phpunit/tests/post/output.php
- Timestamp:
- 09/30/2016 03:23:05 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/output.php
r36329 r38679 171 171 kses_remove_filters(); 172 172 } 173 174 /**175 * @ticket 27246176 */177 public function test_the_excerpt_invalid_post() {178 $this->assertSame( '', get_echo( 'the_excerpt' ) );179 $this->assertSame( '', get_the_excerpt() );180 }181 182 /**183 * @ticket 27246184 * @expectedDeprecated get_the_excerpt185 */186 public function test_the_excerpt_deprecated() {187 $this->assertSame( '', get_the_excerpt( true ) );188 $this->assertSame( '', get_the_excerpt( false ) );189 }190 191 /**192 * @ticket 27246193 */194 public function test_the_excerpt() {195 $GLOBALS['post'] = self::factory()->post->create_and_get( array( 'post_excerpt' => 'Post excerpt' ) );196 $this->assertSame( "<p>Post excerpt</p>\n", get_echo( 'the_excerpt' ) );197 $this->assertSame( 'Post excerpt', get_the_excerpt() );198 }199 200 /**201 * @ticket 27246202 * @ticket 35486203 */204 public function test_the_excerpt_password_protected_post() {205 $post = self::factory()->post->create_and_get( array( 'post_excerpt' => 'Post excerpt', 'post_password' => '1234' ) );206 $this->assertSame( 'There is no excerpt because this is a protected post.', get_the_excerpt( $post ) );207 208 $GLOBALS['post'] = $post;209 $this->assertSame( "<p>There is no excerpt because this is a protected post.</p>\n", get_echo( 'the_excerpt' ) );210 }211 212 /**213 * @ticket 27246214 */215 public function test_the_excerpt_specific_post() {216 $GLOBALS['post'] = self::factory()->post->create_and_get( array( 'post_excerpt' => 'Foo' ) );217 $post_id = self::factory()->post->create( array( 'post_excerpt' => 'Bar' ) );218 $this->assertSame( 'Bar', get_the_excerpt( $post_id ) );219 }220 173 }
Note: See TracChangeset
for help on using the changeset viewer.