Opened 8 years ago
Closed 8 years ago
#32984 closed defect (bug) (fixed)
Several PHPUnit tests cannot be run individually
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.3 | Priority: | normal |
Severity: | normal | Version: | 4.3 |
Component: | Build/Test Tools | Keywords: | has-patch |
Focuses: | Cc: |
Description
Several PHPUnit tests cannot be run individually as they reference classes from other files that may not be loaded. For example:
$phpunit tests/phpunit/tests/filesystem/find_folder.php PHP Fatal error: Class 'WP_Filesystem_UnitTestCase' not found in tests/phpunit/tests/filesystem/find_folder.php on line 7
Attachments (2)
Change History (7)
#1
@
8 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
Good catch. We should still support PHP 5.2.x in our tests, so let's use dirname( __FILE__ )
instead of __DIR__
. Also, no need for DIRECTORY_SEPARATOR
in this context.
#2
follow-up:
↓ 3
@
8 years ago
I've attached make-wp-tests-independent-svn.diff to satisfy the PHP 5.2 concern. This is a SVN diff as opposed to the prior GIT diff, if that is of any importance.
#3
in reply to:
↑ 2
@
8 years ago
- Keywords has-patch added; needs-patch removed
Replying to isaacchapman:
I've attached make-wp-tests-independent-svn.diff to satisfy the PHP 5.2 concern. This is a SVN diff as opposed to the prior GIT diff, if that is of any importance.
Thanks for the patch, if you take a closer look at the Git patch it has a/
and b/
prefixes for the file paths, that's the only difference, as such if you generate patches using git diff --no-prefix
those a/b prefixes will not be there and for all intensive purposes it is then the equivalent of the SVN patch and we're happy to accept patches in SVN or Git.
require_once commands to allow independent test execution