Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (8 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

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

    r39095 r42343  
    6060    public function test_with_utf8_term_slugs() {
    6161        register_taxonomy( 'wptests_tax', 'post' );
    62         $term_id1 = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax', 'name' => 'Первая метка' ) );
    63         $term_id2 = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax', 'name' => 'Вторая метка' ) );
    64         $term_id3 = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax', 'name' => '25кадр' ) );
     62        $term_id1 = self::factory()->term->create(
     63            array(
     64                'taxonomy' => 'wptests_tax',
     65                'name'     => 'Первая метка',
     66            )
     67        );
     68        $term_id2 = self::factory()->term->create(
     69            array(
     70                'taxonomy' => 'wptests_tax',
     71                'name'     => 'Вторая метка',
     72            )
     73        );
     74        $term_id3 = self::factory()->term->create(
     75            array(
     76                'taxonomy' => 'wptests_tax',
     77                'name'     => '25кадр',
     78            )
     79        );
    6580        wp_set_post_terms( $this->post_id, array( $term_id1, $term_id2, $term_id3 ), 'wptests_tax' );
    6681
     
    88103
    89104        $class = get_body_class();
    90         $this->assertContains( "single-post", $class );
     105        $this->assertContains( 'single-post', $class );
    91106        $this->assertContains( "postid-{$post_id}", $class );
    92         $this->assertContains( "single-format-standard", $class );
     107        $this->assertContains( 'single-format-standard', $class );
    93108    }
    94109
    95110    public function test_page_template_body_classes_no_template() {
    96         $post_id = self::factory()->post->create( array(
    97             'post_type' => 'page',
    98         ) );
     111        $post_id = self::factory()->post->create(
     112            array(
     113                'post_type' => 'page',
     114            )
     115        );
    99116        $this->go_to( get_permalink( $post_id ) );
    100117
     
    106123
    107124    public function test_page_template_body_classes() {
    108         $post_id = self::factory()->post->create( array(
    109             'post_type' => 'page',
    110         ) );
     125        $post_id = self::factory()->post->create(
     126            array(
     127                'post_type' => 'page',
     128            )
     129        );
    111130
    112131        add_post_meta( $post_id, '_wp_page_template', 'templates/cpt.php' );
     
    126145     */
    127146    public function test_page_template_body_classes_attachment() {
    128         $post_id = self::factory()->post->create( array(
    129             'post_type' => 'attachment',
    130         ) );
     147        $post_id = self::factory()->post->create(
     148            array(
     149                'post_type' => 'attachment',
     150            )
     151        );
    131152
    132153        add_post_meta( $post_id, '_wp_page_template', 'templates/cpt.php' );
     
    166187        $post_id = self::factory()->post->create();
    167188
    168         $attachment_id = self::factory()->attachment->create_object( 'image.jpg', $post_id, array(
    169             'post_mime_type' => 'image/jpeg',
    170         ) );
     189        $attachment_id = self::factory()->attachment->create_object(
     190            'image.jpg', $post_id, array(
     191                'post_mime_type' => 'image/jpeg',
     192            )
     193        );
    171194
    172195        $this->go_to( get_permalink( $attachment_id ) );
Note: See TracChangeset for help on using the changeset viewer.