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

    r38944 r42343  
    2222                "one is <\n two",
    2323                array(
    24                     'oneline' => 'one is &lt; two',
     24                    'oneline'   => 'one is &lt; two',
    2525                    'multiline' => "one is &lt;\n two",
    2626                ),
     
    2929                "foo <div\n> bar",
    3030                array(
    31                     'oneline' => 'foo bar',
    32                     'multiline' => "foo  bar",
     31                    'oneline'   => 'foo bar',
     32                    'multiline' => 'foo  bar',
    3333                ),
    3434            ),
     
    3636                "foo <\ndiv\n> bar",
    3737                array(
    38                     'oneline' => 'foo &lt; div > bar',
     38                    'oneline'   => 'foo &lt; div > bar',
    3939                    'multiline' => "foo &lt;\ndiv\n> bar",
    4040                ),
     
    5151                'we  trim  extra  internal  whitespace  only  in  single  line  texts',
    5252                array(
    53                     'oneline' => 'we trim extra internal whitespace only in single line texts',
     53                    'oneline'   => 'we trim extra internal whitespace only in single line texts',
    5454                    'multiline' => 'we  trim  extra  internal  whitespace  only  in  single  line  texts',
    5555                ),
     
    5858                "tabs \tget removed in single line texts",
    5959                array(
    60                     'oneline' => 'tabs get removed in single line texts',
     60                    'oneline'   => 'tabs get removed in single line texts',
    6161                    'multiline' => "tabs \tget removed in single line texts",
    6262                ),
     
    6565                "newlines are allowed only\n in multiline texts",
    6666                array(
    67                     'oneline' => 'newlines are allowed only in multiline texts',
     67                    'oneline'   => 'newlines are allowed only in multiline texts',
    6868                    'multiline' => "newlines are allowed only\n in multiline texts",
    6969                ),
     
    7777                B removing %a
    7878                b octets even when %a   B they are obscured by whitespace',
    79                 array (
    80                     'oneline' => 'We don\'t need to wory about %A B removing %a b octets even when %a B they are obscured by whitespace',
     79                array(
     80                    'oneline'   => 'We don\'t need to wory about %A B removing %a b octets even when %a B they are obscured by whitespace',
    8181                    'multiline' => "We don't need to wory about %A\n                B removing %a\n             b octets even when %a   B they are obscured by whitespace",
    8282                ),
     
    103103    function test_sanitize_text_field( $string, $expected ) {
    104104        if ( is_array( $expected ) ) {
    105             $expected_oneline = $expected['oneline'];
     105            $expected_oneline   = $expected['oneline'];
    106106            $expected_multiline = $expected['multiline'];
    107107        } else {
Note: See TracChangeset for help on using the changeset viewer.