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

    r33271 r42343  
    66class Tests_Formatting_WPSpecialchars extends WP_UnitTestCase {
    77    function test_wp_specialchars_basics() {
    8         $html =  "&<hello world>";
     8        $html = '&<hello world>';
    99        $this->assertEquals( $html, _wp_specialchars( $html ) );
    1010
    11         $double = "&<hello world>";
     11        $double = '&<hello world>';
    1212        $this->assertEquals( $double, _wp_specialchars( $html, ENT_NOQUOTES, false, true ) );
    1313    }
     
    3232        foreach ( $ents as $ent ) {
    3333            $escaped = '&' . $ent . ';';
    34             $ent = '&' . $ent . ';';
     34            $ent     = '&' . $ent . ';';
    3535            $this->assertEquals( $escaped, _wp_specialchars( $ent ) );
    3636        }
     
    3939    function test_optionally_escapes_quotes() {
    4040        $source = "\"'hello!'\"";
    41         $this->assertEquals( '"'hello!'"', _wp_specialchars($source, 'single') );
    42         $this->assertEquals( ""'hello!'"", _wp_specialchars($source, 'double') );
    43         $this->assertEquals( '"'hello!'"', _wp_specialchars($source, true) );
    44         $this->assertEquals( $source, _wp_specialchars($source) );
     41        $this->assertEquals( '"'hello!'"', _wp_specialchars( $source, 'single' ) );
     42        $this->assertEquals( ""'hello!'"", _wp_specialchars( $source, 'double' ) );
     43        $this->assertEquals( '"'hello!'"', _wp_specialchars( $source, true ) );
     44        $this->assertEquals( $source, _wp_specialchars( $source ) );
    4545    }
    4646
Note: See TracChangeset for help on using the changeset viewer.