Opened 11 years ago
Closed 11 years ago
#25065 closed defect (bug) (fixed)
The unit tests assume that PHPUnit is installed via PEAR
Reported by: | scribu | Owned by: | dd32 |
---|---|---|---|
Milestone: | 3.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Unit Tests | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
PHPUnit officially supports 3 installation methods:
- via PEAR
- via Phar file
- via Composer
Core apparently only supports the first one, which also happens to be the most cumbersome.
Steps to reproduce:
- Install PHPUnit via Phar:
wget http://pear.phpunit.de/get/phpunit.phar chmod +x phpunit.phar mv phpunit.phar /usr/local/bin/phpunit
- Try to run the WP test suite with it:
phpunit -c tests/phpunit.xml
Result:
PHP Fatal error: require_once(): Failed opening required 'PHPUnit/Autoload.php' (include_path='.:/usr/local/Cellar/php55/5.5.1/lib/php') in /Users/User/svn/wp-develop/tests/includes/bootstrap.php on line 7
Attachments (1)
Change History (14)
#2
@
11 years ago
- Keywords has-patch needs-testing added
The patch fixes the case when PHPUnit is installed as a Phar file.
I don't know if it works when it's installed as a PEAR package, because I wasn't able to install it in that manner.
#5
follow-up:
↓ 6
@
11 years ago
- Keywords needs-testing removed
- Milestone changed from Awaiting Review to 3.7
Cool. Setting this to 3.7 milestone, since there doesn't seem to be a Tools milestone.
#6
in reply to:
↑ 5
@
11 years ago
Replying to scribu:
Cool. Setting this to 3.7 milestone, since there doesn't seem to be a Tools milestone.
We're still working out how exactly we're going to handle our revamped workflows (including features-as-plugins starting in 3.8) but in this case 3.7 is quite fine as we're now tagging/branching our tools like source.
#7
follow-up:
↓ 9
@
11 years ago
I can confirm the issue and that the patch above works.
One comment though - the patched file from the diff is tests/includes/bootstrap.php
, on my just checked out setup from here (as per the handbook) it's in includes/bootstrap.php
instead and not in the tests folder. Not sure if it matters, but just saying.
#9
in reply to:
↑ 7
;
follow-up:
↓ 11
@
11 years ago
Replying to nofearinc:
One comment though - the patched file from the diff is
tests/includes/bootstrap.php
, on my just checked out setup from here (as per the handbook) it's inincludes/bootstrap.php
instead and not in the tests folder. Not sure if it matters, but just saying.
It appears the handbook probably hasn't been updated yet, but we're in the midst of changing to a new SVN structure which lives at http://develop.svn.wordpress.org/trunk/ - See http://make.wordpress.org/core/2013/08/06/a-new-frontier-for-core-development/
#10
@
11 years ago
I still think it is save for now to create the patch from the unit tests folder since the folder name can/will change when the JS unit tests arrive.
#11
in reply to:
↑ 9
;
follow-up:
↓ 12
@
11 years ago
Replying to dd32:
It appears the handbook probably hasn't been updated yet, but we're in the midst of changing to a new SVN structure which lives at http://develop.svn.wordpress.org/trunk/ - See http://make.wordpress.org/core/2013/08/06/a-new-frontier-for-core-development/
I'm aware of the change, but: 1) the handbook should be updated (this is a memo) and 2) there is ambiguity due to the existence of tests/includes
folder within the wordpress tests folder, and 3) not sure if the tests would be in tests/
at the end or phpunit/
or something when the migration is fully complete (due to JS tests, or some Behat additions or whatever is to be added as other tests)
#12
in reply to:
↑ 11
@
11 years ago
Replying to nofearinc:
I'm aware of the change, but: 1) the handbook should be updated (this is a memo)
I've updated the handbook this morning to point to the new SVN structure. Could you please review it to ensure it is accurate?
Also, the Writing Tests section still needs to be written. If anyone would like to volunteer to do that, it would be most appreciated. :)
remove loading of PHPUnit/Autoload.php