Closed (fixed)
Project:
Drush
Component:
Tests
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 May 2011 at 12:23 UTC
Updated:
4 Jan 2014 at 00:53 UTC
Jump to comment: Most recent, Most recent file
I made some changes to enhance Windows support and to integrate the phpunit support of PTI (PHP Tool Integration) for Eclipse.
The attached screenshot shows the settings I use to run the unit test with PTI.
The attached patch makes sure that following constants are set:
UNISH_DB_URL: Default is the same value as in phpunit.xml.distUNISH_DRUSH: Added a Windows workaround for the which command.UNISH_SANDBOX: Uses a sub-folder in the path returned by sys_get_temp_dir().| Comment | File | Size | Author |
|---|---|---|---|
| #3 | drush-test-escaping.patch | 6.07 KB | greg.1.anderson |
| eclipse-pti-settings.png | 91.28 KB | das-peter | |
| drush-windows-testcase-default-constants.diff | 1.95 KB | das-peter |
Comments
Comment #1
moshe weitzman commentedLooks really good. We'll want to refactor that check for is_windows in the future. Will commit this soon unless someone objects.
Comment #2
greg.1.anderson commentedYes, looks good to me too.
Comment #3
greg.1.anderson commentedI don't think that it hurts to commit #0, but there are still some open issues that keep patches from running.
I'm running phpunit under MINGW. In that environment, the patch sets UNISH_DRUSH to c:\Users\Greg Anderson\drush\drush, which does not work; however, I think the reason it does not work is due to a bug in the drush script, which works if you call it as "/c/Users/Greg Anderson/drush/drush", but does not find SELF_PATH correctly if you use "c:\...". Perhaps this is a separate issue.
The Windows test cases also cannot be run when the path to drush contains spaces; common on Windows. Enclosed is a patch that begins to address these issues.
Maybe this should be separate from #0; it's okay with me if you want to commit it. If you do that, I'll keep working in another issue.
Comment #4
moshe weitzman commentedI started with das-peter's patch and it was oddly failing for me on OSX. I quickly figured out that PHP_OS is DARWIN on my machine but it took a couple hours for light to dawn on me; WIN is actually a substring in DARWIN. What a cruel prank!
Greg's subsequent patch was more strict about WIN so I have committed that with a couple changes.
1. I moved the define() code to the bottom of the page so I could use the is_windows() method there.
2. I changed some new Drush_Testcase:: method calls to self:: for better readability.
I decided to push all three commits for no particular reason.
Lets work on additional problems in a new issue.
Nice work, das-peter.