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/l10n/getLocale.php

    r49027 r51415  
    4040    public function test_network_option_should_be_fallback_on_multisite() {
    4141        if ( ! is_multisite() ) {
    42             $this->markTestSkipped( __METHOD__ . ' requires Multisite.' );
     42            $this->markTestSkipped( 'This test requires Multisite.' );
    4343        }
    4444
     
    6060    public function test_option_should_be_respected_on_nonmultisite() {
    6161        if ( is_multisite() ) {
    62             $this->markTestSkipped( __METHOD__ . ' does not apply to Multisite.' );
     62            $this->markTestSkipped( 'This test does not apply to Multisite.' );
    6363        }
    6464
Note: See TracChangeset for help on using the changeset viewer.