phpunit and bootstrap in xml
Hi
thanks for this really nice IDE. I am really starting to like it. Evene more if i get the following problem solved.
I configure the run Task: with the phpunit.xml and the working directory.
The phpunit.xml contains a boostrap also included in the tests dir.
When I run the test I get this error:
/usr/local/zend/bin/php /private/var/folders/zi/ziIRRE-8EfWTrryCRpl3Bk+++TI/-Tmp-/phpunit_Wl_torsten.php d /Users/torsten/Sites/wl/tests
Testing started at 22:07 ...
E_ERROR: Class 'Wl_Test_Controller' not found
#0 /Users/torsten/Sites/wl/tests/application/controllers/AuthControllerTest.php(4)
PHP Fatal error: Class 'Wl_Test_Controller' not found in /Users/torsten/Sites/wl/tests/application/controllers/AuthControllerTest.php on line 4
Process finished with exit code 255
The Wl_Test_Controller is a Test Controller in my lib, which needs the autload in the bootstrap.
So i suppose it is not used.
Thanks for help
Torsten
Please sign in to leave a comment.
Hi Torsten,
Please provide a screenshot of your phpunit run configuration. Looks like you didn't set a path to XML configuration file.
Thank you for feedback!
Thanks for the answer. The problem seems that the settings are not saved. I confiure like you see in the screenshot.
But when I reenter the configuration. Everything but the Test Directory is gone.
Torsten,
Please elaborate. Do you still have the autoload issue?
Note: Be default working directory is a parent folder of your xml configuration file.
Thank you for feedback!
Hi Nikolay,
yes I still have the autolad problem.
>Note: Be default working directory is a parent folder of your xml configuration file.
Thats how I have done it ?
The problem seems that the path to the phpunit.xml ist not saved.
If I enter the configuration after I closed it, the field is empty
Torsten,
Affected version?
Thank you for feedback!
Torsten,
Yes.
I use PhpStorm 2.1 build #PS-107-120 With Zend Server CE on Mac OS X 10.6.7 with phpunit 3.4.13
Does anyone have any ideas I stell have the problem.
Thanks
Torsten
I Assume that the configurations for "Run" are in .idea/runConfigurations but this directory is empty.
Could there be the Problem ?
Torsten
Hello Torsten,
Sorry for delay. I cannot reproduce the problem on the same build. Please try the latest update(released this night) - PhpStorm 2.1.1.
Let me know if the issue still actual on the latest build.
This is directory for 'shared' run configurations only. Regular run configurations are located in workspace.xml file.
Thank you for feedback!
Mmh sorry I made an update and still the same Problem.
Ic configure everything and when ein re-open the config settings it lokk like that
The XML and Working dir settings are empty
Torsten,
Please send me your 'workspace.xml' file (located inside '.idea' folder) to nikolay.matveev at jetbrains dot com.
Thank you for feedback!
Torsten,
Looks like I found a problem.
It might be confusing, but currently PhpStorm creates a new run configuation every time when you invoke 'Run'(or 'Debug') -> 'YourClassNameTest' from context menu. I will work on the problem and try to improve this behavior(it is necessary to find for existing configuration before).
At the moment I can suggest you two possible ways:
1) Set default path for XML configuration file. See screenshot:
2) Don't use context menu and execute(run or debug) existing run configuration from Run\Debug combobox. See screenshot.
Please try one of suggested methods and let me know about result.
Thank you for feedback!
Torsten,
Do you still have the issue?
Thank you for feedback!
Thanks for asking. I have been quite busy. And Didn't have time to really check it.
What happens now is: I start the test and nothing happens, only the option to run again in the context menue dissapears.
This is the error I Get now:
/usr/local/zend/bin/php /private/var/folders/zi/ziIRRE-8EfWTrryCRpl3Bk+++TI/-Tmp-/phpunit_core_torsten.php -config /Users/torsten/Sites/wdv/php-inc/core/tests/phpunit.xml d /Users/torsten/Sites/wdv/php-inc/core/tests
Testing started at 21:30 ...
E_ERROR: Call to protected method PHPUnit_TextUI_Command::handleLoader() from context 'MyTestRunner'
#0 /private/var/folders/zi/ziIRRE-8EfWTrryCRpl3Bk+++TI/-Tmp-/phpunit_core_torsten.php(599)
PHP Fatal error: Call to protected method PHPUnit_TextUI_Command::handleLoader() from context 'MyTestRunner' in /private/var/folders/zi/ziIRRE-8EfWTrryCRpl3Bk+++TI/-Tmp-/phpunit_core_torsten.php on line 599
Process finished with exit code 255
I removed the testSuiteLoaderClass defintion from the phpunit.xml and everything works fine!
I really like this IDE and I am going to switch from Zend Studio
Thanks Torsten
Hello Torsten,
Unfortunately it is a bug in our test runner implementation and we don't support testSuiteLoaderClass. I created an issue about that - http://youtrack.jetbrains.net/issue/WI-6838. Please vote it.
Also could you send me your 'phpunit.xml' file?
Thank you for feedback!
<phpunit backupGlobals="false" backupStaticAttributes="false"
bootstrap="bootstrap.php" colors="true" convertErrorsToExceptions="true"
convertNoticesToExceptions="true" convertWarningsToExceptions="true"
processIsolation="false" stopOnFailure="false" syntaxCheck="false"
>
<testsuites>
<testsuite name="Tests">
<directory>application</directory>
<directory>lib</directory>
</testsuite>
</testsuites>
</phpunit>
By The way it doesn't seem to use the dirs in The Testsuite. The tests run over all directories in the test dir.
Torsten
Torsten,
Thanks for sharing!
It depends on scope defined in run configuration settings. If you want phpunit launcher use scopes defined in configuration file select 'XML file' in run configuration settings.
Thank you for feedback!