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/formatting/GetUrlInContent.php

    r33905 r42343  
    55 */
    66class Tests_Formatting_GetUrlInContent extends WP_UnitTestCase {
    7    
     7
    88    /**
    99     * URL Content Data Provider
     
    1212     */
    1313    public function get_input_output() {
    14         return array (
    15             array (
    16                 "",
    17                 false
     14        return array(
     15            array(
     16                '',
     17                false,
    1818            ), //empty content
    19             array (
    20                 "<div>NO URL CONTENT</div>",
    21                 false
     19            array(
     20                '<div>NO URL CONTENT</div>',
     21                false,
    2222            ), //no URLs
    23             array (
     23            array(
    2424                '<div href="/relative.php">NO URL CONTENT</div>',
    25                 false
     25                false,
    2626            ), // ignore none link elements
    27             array (
     27            array(
    2828                'ABC<div><a href="/relative.php">LINK</a> CONTENT</div>',
    29                 "/relative.php"
     29                '/relative.php',
    3030            ), // single link
    31             array (
     31            array(
    3232                'ABC<div><a href="/relative.php">LINK</a> CONTENT <a href="/suppress.php">LINK</a></div>',
    33                 "/relative.php"
     33                '/relative.php',
    3434            ), // multiple links
    35             array (
     35            array(
    3636                'ABC<div><a href="http://example.com/Mr%20WordPress 2">LINK</a> CONTENT </div>',
    37                 "http://example.com/Mr%20WordPress%202"
     37                'http://example.com/Mr%20WordPress%202',
    3838            ), // escape link
    3939        );
     
    4242    /**
    4343     * Validate the get_url_in_content function
     44     *
    4445     * @dataProvider get_input_output
    4546     */
    4647    function test_get_url_in_content( $in_str, $exp_str ) {
    47         $this->assertEquals($exp_str, get_url_in_content( $in_str ) );
     48        $this->assertEquals( $exp_str, get_url_in_content( $in_str ) );
    4849    }
    4950}
Note: See TracChangeset for help on using the changeset viewer.