WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/08/2019 12:55:20 AM (2 years ago)
Author:
pento
Message:

Coding Standards: Fix the remaining issues in /tests.

All PHP files in /tests now conform to the PHP coding standards, or have exceptions appropriately marked.

Travis now also runs phpcs on the /tests directory, any future changes to these files must conform entirely to the WordPress PHP coding standards. 🎉

See #47632.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/shortcode.php

    r44569 r45607  
    3939    // [footag foo="bar"]
    4040    function _shortcode_footag( $atts ) {
    41         return @"foo = {$atts['foo']}";
     41        $foo = isset( $atts['foo'] ) ? $atts['foo'] : '';
     42        return "foo = $foo";
    4243    }
    4344
     
    445446    function _filter_atts2( $out, $pairs, $atts ) {
    446447        // If foo attribute equals "foo1", change it to be default value
    447         if ( isset( $out['foo'] ) && 'foo1' == $out['foo'] ) {
     448        if ( isset( $out['foo'] ) && 'foo1' === $out['foo'] ) {
    448449            $out['foo'] = $pairs['foo'];
    449450        }
Note: See TracChangeset for help on using the changeset viewer.