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.dist
  • UNISH_DRUSH: Added a Windows workaround for the which command.
  • UNISH_SANDBOX: Uses a sub-folder in the path returned by sys_get_temp_dir().

Comments

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

Looks really good. We'll want to refactor that check for is_windows in the future. Will commit this soon unless someone objects.

greg.1.anderson’s picture

Yes, looks good to me too.

greg.1.anderson’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new6.07 KB

I 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.

moshe weitzman’s picture

Version: 7.x-4.4 »
Status: Needs work » Fixed

I 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.

Automatically closed -- issue fixed for 2 weeks with no activity.