| 95 | /** |
| 96 | * @ticket 38225 |
| 97 | */ |
| 98 | public function test_attachment_body_classes() { |
| 99 | $post_id = self::factory()->post->create(); |
| 100 | $file = DIR_TESTDATA . '/images/canola.jpg'; |
| 101 | $attachment_id = self::factory()->attachment->create_object( $file, $post_id, array( |
| 102 | 'post_mime_type' => 'image/jpeg', |
| 103 | ) ); |
| 104 | |
| 105 | $this->go_to( get_permalink( $attachment_id ) ); |
| 106 | |
| 107 | $class = get_body_class(); |
| 108 | $this->assertContains( 'attachment', $class ); |
| 109 | $this->assertContains( "attachmentid-{$attachment_id}", $class ); |
| 110 | $this->assertContains( 'attachment-jpeg', $class ); |
| 111 | } |