Opened 11 years ago
Closed 11 years ago
#32984 closed defect (bug) (fixed)
Several PHPUnit tests cannot be run individually
| Reported by: | isaacchapman | Owned by: | boonebgorges |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.3 |
| Component: | Build/Test Tools | Version: | 4.3 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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
@
11 years ago
- Keywords needs-patch added
- Milestone Awaiting Review → 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
@
11 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
@
11 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
require_once commands to allow independent test execution