Changeset 37915 for trunk/tests/phpunit/tests/media.php
- Timestamp:
- 06/29/2016 05:28:00 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/media.php
r37702 r37915 903 903 904 904 /** 905 * @ticket 12235 906 */ 907 function test_wp_get_attachment_caption() { 908 $this->assertFalse( wp_get_attachment_caption( 0 ) ); 909 910 $caption = 'This is a caption.'; 911 912 $post_id = self::factory()->post->create(); 913 $attachment_id = self::factory()->attachment->create_object( $this->img_name, $post_id, array( 914 'post_mime_type' => 'image/jpeg', 915 'post_type' => 'attachment', 916 'post_excerpt' => $caption, 917 ) ); 918 919 $this->assertFalse( wp_get_attachment_caption( $post_id ) ); 920 921 $this->assertEquals( $caption, wp_get_attachment_caption( $attachment_id ) ); 922 } 923 924 /** 925 * @ticket 12235 926 */ 927 function test_wp_get_attachment_caption_empty() { 928 $post_id = self::factory()->post->create(); 929 $attachment_id = self::factory()->attachment->create_object( $this->img_name, $post_id, array( 930 'post_mime_type' => 'image/jpeg', 931 'post_type' => 'attachment', 932 'post_excerpt' => '', 933 ) ); 934 935 $this->assertEquals( '', wp_get_attachment_caption( $attachment_id ) ); 936 } 937 938 /** 905 939 * Helper function to get image size array from size "name" 906 940 */
Note: See TracChangeset
for help on using the changeset viewer.