Opened 5 years ago
Closed 5 years ago
#50236 closed enhancement (fixed)
Extend namespaced version of PHPUnit's test case class
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description ¶
Now that WordPress requires at least PHP 5.6 we're also able to use namespaces.
PHPUnit uses namespaces which forced us to provide custom class aliases to make our tests compatible with PHPUnit 6 (and PHP 5.2), see #39822.
For running the tests on PHP 5.6 we're using PHPUnit 5 which should be our minimum supported version. Since PHPUnit\Framework\TestCase
is already available in PHPUnit 5 it should be safe to replace it. The tests are still passing.
The change would solve autocompleting issues with editors which are not resolving the custom class aliases when you use PHPUnit 7 for example.
Pull Requests
- Loading…
Note: See
TracTickets for help on using
tickets.
Replace the old
PHPUnit_Framework_TestCase
class, [currently aliased](https://github.com/WordPress/wordpress-develop/blob/4b79e69d890b0444e5b2adfedca50f55a6bd3421/tests/phpunit/includes/phpunit6/compat.php#L5), to the new namespaced class.Trac ticket: https://core.trac.wordpress.org/ticket/50236