WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (3 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/attachment/slashes.php

    r35244 r42343  
    2525    /**
    2626     * Tests the model function that expects slashed data
    27      *
    2827     */
    2928    function test_wp_insert_attachment() {
    30         $id = wp_insert_attachment(array(
    31             'post_status' => 'publish',
    32             'post_title' => $this->slash_1,
    33             'post_content_filtered' => $this->slash_3,
    34             'post_excerpt' => $this->slash_5,
    35             'post_type' => 'post'
    36         ));
     29        $id   = wp_insert_attachment(
     30            array(
     31                'post_status'           => 'publish',
     32                'post_title'            => $this->slash_1,
     33                'post_content_filtered' => $this->slash_3,
     34                'post_excerpt'          => $this->slash_5,
     35                'post_type'             => 'post',
     36            )
     37        );
    3738        $post = get_post( $id );
    3839
     
    4142        $this->assertEquals( wp_unslash( $this->slash_5 ), $post->post_excerpt );
    4243
    43         $id = wp_insert_attachment(array(
    44             'post_status' => 'publish',
    45             'post_title' => $this->slash_2,
    46             'post_content_filtered' => $this->slash_4,
    47             'post_excerpt' => $this->slash_6,
    48             'post_type' => 'post'
    49         ));
     44        $id   = wp_insert_attachment(
     45            array(
     46                'post_status'           => 'publish',
     47                'post_title'            => $this->slash_2,
     48                'post_content_filtered' => $this->slash_4,
     49                'post_excerpt'          => $this->slash_6,
     50                'post_type'             => 'post',
     51            )
     52        );
    5053        $post = get_post( $id );
    5154
Note: See TracChangeset for help on using the changeset viewer.