Make WordPress Core


Ignore:
Timestamp:
07/08/2019 12:55:20 AM (5 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/multisite/site.php

    r44806 r45607  
    167167            // Check existence of each database table for the created site.
    168168            foreach ( $wpdb->tables( 'blog', false ) as $table ) {
    169                 $suppress     = $wpdb->suppress_errors();
     169                $suppress = $wpdb->suppress_errors();
     170
     171                // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
    170172                $table_fields = $wpdb->get_results( "DESCRIBE $prefix$table;" );
     173
    171174                $wpdb->suppress_errors( $suppress );
    172175
     
    175178
    176179                // And the table should not be empty, unless commentmeta, termmeta, or links.
     180                // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
    177181                $result = $wpdb->get_results( "SELECT * FROM $prefix$table LIMIT 1" );
    178                 if ( 'commentmeta' == $table || 'termmeta' == $table || 'links' == $table ) {
     182
     183                if ( 'commentmeta' === $table || 'termmeta' === $table || 'links' === $table ) {
    179184                    $this->assertEmpty( $result );
    180185                } else {
     
    245250            $prefix = $wpdb->get_blog_prefix( $blog_id );
    246251            foreach ( $wpdb->tables( 'blog', false ) as $table ) {
    247                 $suppress     = $wpdb->suppress_errors();
     252                $suppress = $wpdb->suppress_errors();
     253
     254                // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
    248255                $table_fields = $wpdb->get_results( "DESCRIBE $prefix$table;" );
     256
    249257                $wpdb->suppress_errors( $suppress );
    250258                $this->assertNotEmpty( $table_fields, $prefix . $table );
     
    283291            $prefix = $wpdb->get_blog_prefix( $blog_id );
    284292            foreach ( $wpdb->tables( 'blog', false ) as $table ) {
    285                 $suppress     = $wpdb->suppress_errors();
     293                $suppress = $wpdb->suppress_errors();
     294
     295                // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
    286296                $table_fields = $wpdb->get_results( "DESCRIBE $prefix$table;" );
     297
    287298                $wpdb->suppress_errors( $suppress );
    288299                $this->assertEmpty( $table_fields );
     
    321332            $prefix = $wpdb->get_blog_prefix( $blog_id );
    322333            foreach ( $wpdb->tables( 'blog', false ) as $table ) {
    323                 $suppress     = $wpdb->suppress_errors();
     334                $suppress = $wpdb->suppress_errors();
     335
     336                // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
    324337                $table_fields = $wpdb->get_results( "DESCRIBE $prefix$table;" );
     338
    325339                $wpdb->suppress_errors( $suppress );
    326340                $this->assertNotEmpty( $table_fields, $prefix . $table );
     
    856870         */
    857871        function _domain_exists_cb( $exists, $domain, $path, $site_id ) {
    858             if ( 'foo' == $domain && 'bar/' == $path ) {
     872            if ( 'foo' === $domain && 'bar/' === $path ) {
    859873                return 1234;
    860874            } else {
Note: See TracChangeset for help on using the changeset viewer.