Make WordPress Core

Changeset 51570


Ignore:
Timestamp:
08/07/2021 10:46:54 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Build/Test Tools: Alias the Getopt class conditionally, as the class no longer exists in PHPUnit 9.x.

Most of the aliasing in this compat.php file is redundant as PHPUnit 5.7.21+ contains a forward compatibility layer for these classes anyway (= PHPUnit provides both the namespaced and underscore named versions of these classes in PHPUnit 5.7.21+).

All the same, the file and the aliases are left in place for the time being, as plugins/themes using the WP test suite as the basis for their integration tests may rely on it, though WP itself should not really need it anymore, save for maybe one or two classes.

Follow-up to [51559-51569].

Props jrf.
See #46149.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/phpunit6/compat.php

    r50986 r51570  
    1515    class_alias( 'PHPUnit\Framework\TestListener', 'PHPUnit_Framework_TestListener' );
    1616    class_alias( 'PHPUnit\Util\GlobalState', 'PHPUnit_Util_GlobalState' );
    17     class_alias( 'PHPUnit\Util\Getopt', 'PHPUnit_Util_Getopt' );
     17    if ( class_exists( 'PHPUnit\Util\Getopt' ) ) {
     18        class_alias( 'PHPUnit\Util\Getopt', 'PHPUnit_Util_Getopt' );
     19    }
    1820
    1921    class PHPUnit_Util_Test {
Note: See TracChangeset for help on using the changeset viewer.