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/formats.php

    r35242 r42343  
    9999     */
    100100    function test_get_url_in_content() {
    101         $link = 'http://nytimes.com';
    102         $commentary = 'This is my favorite link';
    103         $link_with_commentary =<<<DATA
     101        $link                 = 'http://nytimes.com';
     102        $commentary           = 'This is my favorite link';
     103        $link_with_commentary = <<<DATA
    104104$link
    105105
    106106$commentary
    107107DATA;
    108         $href = '<a href="http://nytimes.com">NYT</a>';
    109         $href_with_commentary =<<<DATA
     108        $href                 = '<a href="http://nytimes.com">NYT</a>';
     109        $href_with_commentary = <<<DATA
    110110$href
    111111
    112112$commentary
    113113DATA;
    114         $link_post_id = self::factory()->post->create( array( 'post_content' => $link ) );
    115         $content_link = get_url_in_content( get_post_field( 'post_content', $link_post_id ) );
     114        $link_post_id         = self::factory()->post->create( array( 'post_content' => $link ) );
     115        $content_link         = get_url_in_content( get_post_field( 'post_content', $link_post_id ) );
    116116        $this->assertEquals( false, $content_link );
    117117
    118118        $link_with_post_id = self::factory()->post->create( array( 'post_content' => $link_with_commentary ) );
    119         $content_link = get_url_in_content( get_post_field( 'post_content', $link_with_post_id ) );
     119        $content_link      = get_url_in_content( get_post_field( 'post_content', $link_with_post_id ) );
    120120        $this->assertEquals( false, $content_link );
    121121
     
    127127
    128128        $empty_post_id = self::factory()->post->create( array( 'post_content' => '' ) );
    129         $content_link = get_url_in_content( get_post_field( 'post_content', $empty_post_id ) );
     129        $content_link  = get_url_in_content( get_post_field( 'post_content', $empty_post_id ) );
    130130        $this->assertEquals( false, $content_link );
    131131
     
    140140
    141141        $href_with_post_id = self::factory()->post->create( array( 'post_content' => $href_with_commentary ) );
    142         $content_link = get_url_in_content( get_post_field( 'post_content', $href_with_post_id ) );
     142        $content_link      = get_url_in_content( get_post_field( 'post_content', $href_with_post_id ) );
    143143        $this->assertEquals( $link, $content_link );
    144144
     
    150150
    151151        $empty_post_id = self::factory()->post->create( array( 'post_content' => '' ) );
    152         $content_link = get_url_in_content( get_post_field( 'post_content', $empty_post_id ) );
     152        $content_link  = get_url_in_content( get_post_field( 'post_content', $empty_post_id ) );
    153153        $this->assertEquals( false, $content_link );
    154154
Note: See TracChangeset for help on using the changeset viewer.