Make WordPress Core


Ignore:
Timestamp:
07/13/2021 10:43:42 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Tests: Clean up skipping conditions and requirements for various tests.

This improves the consistency of test skipping and ensures that:

  • The @requires annotations use the right condition and format, and are on the right level (class vs. function).
  • Inline conditions with a markTestSkipped() call are only used when annotations cannot be used.
  • All markTestSkipped() calls contain a verbose explanation of why the test is being skipped.

Props jrf, hellofromTonya.
Fixes #53009.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/db/charset.php

    r50286 r51415  
    763763        if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
    764764            $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
    765             return;
    766765        }
    767766
     
    805804        if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
    806805            $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
    807             return;
    808806        }
    809807
     
    829827        if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
    830828            $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
    831             return;
    832829        }
    833830
     
    857854        if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
    858855            $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
    859             return;
    860856        }
    861857
     
    918914        if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
    919915            $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
    920             return;
    921916        }
    922917
Note: See TracChangeset for help on using the changeset viewer.