Make WordPress Core


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

    r38835 r42343  
    1111        parent::setUp();
    1212
    13         self::$post_id = self::factory()->post->create();
    14         self::$comment_id = self::factory()->comment->create( array(
    15             'comment_post_ID' => self::$post_id,
    16             'comment_approved' => '1',
    17             'comment_author' => 'Bob',
    18             'comment_author_email' => 'bobthebuilder@example.com',
    19             'comment_author_url' => 'http://example.com',
    20             'comment_content' => 'Yes, we can!',
    21         ) );
     13        self::$post_id    = self::factory()->post->create();
     14        self::$comment_id = self::factory()->comment->create(
     15            array(
     16                'comment_post_ID'      => self::$post_id,
     17                'comment_approved'     => '1',
     18                'comment_author'       => 'Bob',
     19                'comment_author_email' => 'bobthebuilder@example.com',
     20                'comment_author_url'   => 'http://example.com',
     21                'comment_content'      => 'Yes, we can!',
     22            )
     23        );
    2224
    2325        update_option( 'comment_whitelist', 0 );
     
    3234
    3335    public function test_allow_comment_if_comment_author_emails_differ() {
    34         $now = time();
     36        $now          = time();
    3537        $comment_data = array(
    36             'comment_post_ID' => self::$post_id,
    37             'comment_author' => 'Bob',
     38            'comment_post_ID'      => self::$post_id,
     39            'comment_author'       => 'Bob',
    3840            'comment_author_email' => 'sideshowbob@example.com',
    39             'comment_author_url' => 'http://example.com',
    40             'comment_content' => 'Yes, we can!',
    41             'comment_author_IP' => '192.168.0.1',
    42             'comment_parent' => 0,
    43             'comment_date_gmt' => date( 'Y-m-d H:i:s', $now ),
    44             'comment_agent' => 'Bobbot/2.1',
    45             'comment_type' => '',
     41            'comment_author_url'   => 'http://example.com',
     42            'comment_content'      => 'Yes, we can!',
     43            'comment_author_IP'    => '192.168.0.1',
     44            'comment_parent'       => 0,
     45            'comment_date_gmt'     => date( 'Y-m-d H:i:s', $now ),
     46            'comment_agent'        => 'Bobbot/2.1',
     47            'comment_type'         => '',
    4648        );
    4749
     
    5557     */
    5658    public function test_die_as_duplicate_if_comment_author_name_and_emails_match() {
    57         $now = time();
     59        $now          = time();
    5860        $comment_data = array(
    59             'comment_post_ID' => self::$post_id,
    60             'comment_author' => 'Bob',
     61            'comment_post_ID'      => self::$post_id,
     62            'comment_author'       => 'Bob',
    6163            'comment_author_email' => 'bobthebuilder@example.com',
    62             'comment_author_url' => 'http://example.com',
    63             'comment_content' => 'Yes, we can!',
    64             'comment_author_IP' => '192.168.0.1',
    65             'comment_parent' => 0,
    66             'comment_date_gmt' => date( 'Y-m-d H:i:s', $now ),
    67             'comment_agent' => 'Bobbot/2.1',
    68             'comment_type' => '',
     64            'comment_author_url'   => 'http://example.com',
     65            'comment_content'      => 'Yes, we can!',
     66            'comment_author_IP'    => '192.168.0.1',
     67            'comment_parent'       => 0,
     68            'comment_date_gmt'     => date( 'Y-m-d H:i:s', $now ),
     69            'comment_agent'        => 'Bobbot/2.1',
     70            'comment_type'         => '',
    6971        );
    7072
Note: See TracChangeset for help on using the changeset viewer.