-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHPUnit bootstrap file loaded multiple times causing a fatal error #14
Comments
MakeGood has provided the required PHP components for MakeGood itself as the com.piece_framework.makegood.stagehandtestrunner plugin. The path to the components is automatically added to the include_path when running a test. The most of the components will be loaded immediately after launching MakeGood's launcher command testrunner.php. To avoid raising the error, specify the bootstrap.php.cache (or another script that loads the bootstrap.php.cache) as the preload script for your project. |
Additionally, you should also define the $_SERVER['KERNEL_DIR'] in your preload script. |
@iteman thanks for the hint, Why is there a special tab for the XML Configuration File of PHPUnit? In which use case would i set this? Also i'm a step further now. When i run tests, i'm getting How does MakeGood determine the php executable to use? |
@pulse00 Hi,
MakeGood works with most elements of the PHPUnit XML configuration file. Especially the <groups> element will help you to run tests only for continuous testing. (e.g. excluding tests with database)
Take a look at the following code: com.piece_framework.makegood.launch.PHPexeItemRepository: public class PHPexeItemRepository {
public PHPexeItem findByProject(IProject project) {
PHPexeItem phpexeItem = PHPDebugPlugin.getPHPexeItem(project);
if (phpexeItem == null) {
return PHPDebugPlugin.getWorkspaceDefaultExe();
}
return phpexeItem;
}
} |
thanks for the clarification. I think i've found what's causing the I have defined the my
Could there be some problem with the launcher not loading the additional ini files? |
@pulse00 Hi,
This is a FAQ for PDT (and also MakeGood). The Eclipse PDT team decided to introduce the -n option to fix the Bug #324073. So only php.ini from /tmp/zend_debug/... has been loaded, and all additional INI files have not been loaded. This has been introduced since PDT 2.2.0 M201010110334 (2010/10/11). For more information, see the following links: |
@iteman sorry for missing that point in the FAQ. i wasn't aware of that issue regarding additional ini files. |
@pulse00 We would be happy If there is a better way to fix the bug :-) |
@iteman i've now setup the executable so all additional ini files are parsed properly. When i run the tests, the Stagehand_TestRunner is executed but with no argument it seems. The console has the following output when running tests:
My project has now the following setup:
|
@pulse00 This is another FAQ for MakeGood, but no documents yet. Unfortunately, I don't know why this issue happens. I've thought that the command line is broken by any reason. Try to restart Eclipse. |
@iteman restarting eclipse with I'm sorry to bug you so much, but now the tests fail because the Symfony WebTestCase throws RuntimeException, because not enough arguments have been passed to the cli: Normally, you run Symfony phpunit tests with the -c option to the
The Symfony tests assume that this argument is being passed to phpunit, if not, it throws that exception above. It would really cool to get Symfony phpunit test working, i'd be adding a corresponding wiki entry if i get it running ;) |
@pulse00 I apologize for the inconvenience. It seems that the error is raised when the $_SERVER['KERNEL_DIR'] is not set:
Symfony guys would be happy to read such wiki entry :-) |
I'm trying to setup MakeGood with a Symfony2 project which uses phpunit with an xml configuration file.
The projects tests work fine when run from the cli manually. When i configure the project in makegood, i'm doing the following:
General
in the projects propertiesXML Configuration file
under thePHPUnit
tabWhen running a test, i'm getting
bootstrap.php.cache
is the bootstrap file specified in phpunits xml config file. It looks like MakeGood is loading that bootstrap file twice somehow.Am i missing something here?
The text was updated successfully, but these errors were encountered: