Make WordPress Core


Ignore:
Timestamp:
01/28/2019 02:10:24 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Build/Test Tools: Add support for PHPUnit 7.x.

  • Create an abstract WP_UnitTestCase_Base class to share between PHPUnit 7.x and older versions.
  • Add a speed-trap loader to determine which SpeedTrapListener class needs to be loaded for the current PHPUnit version.
  • Remove unnecessary PHPUnit\Util\Test and PHPUnit_Util_Getopt inheritances.
  • Update Travis CI config to use PHPUnit 7.x for PHP 7.1, 7.2, and nightly PHP versions.

Props jipmoors, netweb, desrosj, ayeshrajans, soulseekah, SergeyBiryukov.
See #43218.

Location:
trunk/tests/phpunit/includes/phpunit7
Files:
1 added
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/phpunit7/speed-trap-listener.php

    r44700 r44701  
    5555     * @param float                   $time
    5656     */
    57     public function addError( PHPUnit_Framework_Test $test, Exception $e, $time ) {
     57    public function addError( PHPUnit\Framework\Test $test, Throwable $t, float $time ): void {
    5858    }
    5959
     
    6666     * @since Method available since Release 5.1.0
    6767     */
    68     public function addWarning( PHPUnit_Framework_Test $test, PHPUnit_Framework_Warning $e, $time ) {
     68    public function addWarning( PHPUnit\Framework\Test $test, PHPUnit\Framework\Warning $e, float $time ): void {
    6969    }
    7070
     
    7676     * @param float                                   $time
    7777     */
    78     public function addFailure( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time ) {
     78    public function addFailure( PHPUnit\Framework\Test $test, PHPUnit\Framework\AssertionFailedError $e, float $time ): void {
    7979    }
    8080
     
    8686     * @param float                   $time
    8787     */
    88     public function addIncompleteTest( PHPUnit_Framework_Test $test, Exception $e, $time ) {
     88    public function addIncompleteTest( PHPUnit\Framework\Test $test, Throwable $t, float $time ): void {
    8989    }
    9090
     
    9797     * @since  Method available since Release 4.0.0
    9898     */
    99     public function addRiskyTest( PHPUnit_Framework_Test $test, Exception $e, $time ) {
     99    public function addRiskyTest( PHPUnit\Framework\Test $test, Throwable $t, float $time ): void {
    100100    }
    101101
     
    107107     * @param float                   $time
    108108     */
    109     public function addSkippedTest( PHPUnit_Framework_Test $test, Exception $e, $time ) {
     109    public function addSkippedTest( PHPUnit\Framework\Test $test, Throwable $t, float $time ): void {
    110110    }
    111111
     
    115115     * @param PHPUnit_Framework_Test $test
    116116     */
    117     public function startTest( PHPUnit_Framework_Test $test ) {
     117    public function startTest( PHPUnit\Framework\Test $test ): void {
    118118    }
    119119
     
    124124     * @param float                   $time
    125125     */
    126     public function endTest( PHPUnit_Framework_Test $test, $time ) {
     126    public function endTest( PHPUnit\Framework\Test $test, float $time ): void {
    127127        if ( ! $test instanceof PHPUnit_Framework_TestCase ) {
    128128            return;
     
    142142     * @param PHPUnit_Framework_TestSuite $suite
    143143     */
    144     public function startTestSuite( PHPUnit_Framework_TestSuite $suite ) {
     144    public function startTestSuite( PHPUnit\Framework\TestSuite $suite ): void {
    145145        $this->suites++;
    146146    }
     
    151151     * @param PHPUnit_Framework_TestSuite $suite
    152152     */
    153     public function endTestSuite( PHPUnit_Framework_TestSuite $suite ) {
     153    public function endTestSuite( PHPUnit\Framework\TestSuite $suite ): void {
    154154        $this->suites--;
    155155
Note: See TracChangeset for help on using the changeset viewer.