WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/28/2015 05:20:07 PM (4 years ago)
Author:
johnbillion
Message:

Themes: Add singular to the list of body classes when viewing a single post object.

Adds tests

Fixes #35164
Props danielpataki, johnbillion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post/getBodyClass.php

    r35242 r36112  
    7979    }
    8080
     81    /**
     82     * @ticket 35164
     83     */
     84    public function test_singular_body_classes() {
     85        $post_id = self::factory()->post->create();
     86        $this->go_to( get_permalink( $post_id ) );
     87
     88        $class = get_body_class();
     89        $this->assertContains( "single-post", $class );
     90        $this->assertContains( "postid-{$post_id}", $class );
     91        $this->assertContains( "single-format-standard", $class );
     92        $this->assertContains( "singular", $class );
     93
     94    }
     95
    8196}
Note: See TracChangeset for help on using the changeset viewer.