Make WordPress Core


Ignore:
Timestamp:
06/01/2020 07:41:50 PM (6 years ago)
Author:
ocean90
Message:

Build/Test Tools: Let WP_UnitTestCase_Base extend the namespaced version of PHPUnit's test case class.

With the minimum PHP version requirement set to 5.6 we're now able to use namespaces by default. This replaces PHPUnit_Framework_TestCase with PHPUnit\Framework\TestCase for WP_UnitTestCase_Base to solve autocompletion issues with code editors when using more recent PHPUnit versions. PHPUnit\Framework\TestCase is available since PHPUnit 5.4 and now the minimum required PHPUnit version.

Fixes #50236.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/bootstrap.php

    r47496 r47880  
    3838require_once __DIR__ . '/functions.php';
    3939
    40 if ( version_compare( tests_get_phpunit_version(), '8.0', '>=' ) ) {
     40if ( version_compare( tests_get_phpunit_version(), '5.4', '<' ) || version_compare( tests_get_phpunit_version(), '8.0', '>=' ) ) {
    4141    printf(
    42         "Error: Looks like you're using PHPUnit %s. WordPress is currently only compatible with PHPUnit up to 7.x.\n",
     42        "Error: Looks like you're using PHPUnit %s. WordPress requires at least PHPUnit 5.4 and is currently only compatible with PHPUnit up to 7.x.\n",
    4343        tests_get_phpunit_version()
    4444    );
Note: See TracChangeset for help on using the changeset viewer.