Community
Participate
Working Groups
add phpuint library to a php project,and then add the following line in a php file: require_once 'PHPUnit/Extensions/PhptTestCase.php'; $| //$currentErrorReporting should be proposed here
Created attachment 221393 [details] patch
Created attachment 221394 [details] patch
move to DLTK,the patch is to get the right container path for php include path(build path).
Add Natalia to CC
@Zhao both patches are needed, right?
Hi Alex, Yes,both are needed,thanks!
Created attachment 222536 [details] Fixed patch The patch for org.eclispe.dltk.core wouldn't work for Mac and Linux systems. Fixed patch attached.
Alex, any plans on committing those patches?
Natalia, how can I reproduce this? I have DLTK & PDT checked out. How should I add phpunit? Is phpunit.phar supported? or do I need it as sources?
Add PHPUnit sources to include path of your php project. It doesn't work for phar.
Natalia, Zhao, surprisingly it works for me without this patch. Linux, DLTK & PDT from git master. I installed phpunit using composer/required-dev http://www.phpunit.de/manual/current/en/installation.html#installation.composer , so it was unpacked to vendor/phpunit/phpunit then I tried 2 ways: a) require_once 'vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase.php' b) add vendor/phpunit/phpunit to php include path and require_once 'PHPUnit/Extensions/PhptTestCase.php' In both cases $currentErrorReporting completion proposal was available. Could you, perhaps, provide more details on how to reproduce the bug?
Is it windows specific?
The case is you don't have the PHPUnit in your project. Not even in your workspace. Have your PHPUnit sources anywhere on your disk, just not in the project. Configure the include path of your project -> Libraries -> Add External Source folder -> pick your PHPUnit.
And it is not platform specific.
Natalia, now it doesn't work even with the patches. in org.eclipse.php.internal.core.filenetwork.FileNetworkUtility.findSourceModule(ISourceModule, String, Set<String>) line 323 projectFragments is null. for me that folder is handled as BPE_LIBRARY, but IncludedFileResult.setProjectFragments(IProjectFragment[]) is called only from the BPE_CONTAINER branch.
Alex, my bad, I gave you wrong example. The correct flow is: Configure Include Path -> Libraries -> Add Library -> User Library -> Configure -> New -> set name -> Add External Folder (your PHPUnit sources) -> Finish. The one that you tested: Include Path -> Libraries -> Add External Source is not fixed yet.
Fixed in a slightly different way. http://git.eclipse.org/c/dltk/org.eclipse.dltk.core.git/commit/?id=7a5c4e0750a635a39c53fa272dec31b3c629f653
Thanks Alex, are there nightly builds of DLTK available somewhere?
@Natalia https://hudson.eclipse.org/hudson/job/dltk-nightly/lastSuccessfulBuild/artifact/org.eclipse.dltk.releng/build/update.site/target/site/