Make WordPress Core

Ticket #38225: 38225.patch

File 38225.patch, 906 bytes (added by ocean90, 8 years ago)
  • tests/phpunit/tests/post/getBodyClass.php

     
    9292                $this->assertContains( "single-format-standard", $class );
    9393        }
    9494
     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        }
    95112}