1. Run | Edit Configurations ... | Defaults -- edit default settings for the desired PHPUnit configuration type 2. Right click on file with PHPUnit test case (be it in Project View or in editor itself) and choose appropriate item from "Run" submenu (when right clicking in editor, the context matters -- you may see option to test specific method only if clicked while inside that specific method). 3. Temporary configuration will be created (icon will be faded) -- that's how it works: IDE has to have configuration entry to work with; but it will automatically be deleted when limit is reached (by default limit = 5 and you can change it in "Run | Edit Configurations... | Defaults")
From what I understand it is because you extend your test class from My_Test_Database and not from PHPUnit_Framework_TestCase directly. Apparently PhpStorm is unable to acknowledge that this is still PHPUnit test case (for whatever reason it may be -- maybe it cannot find that (or some other intermediate) class to make such decision -- don't know). Properly recognized test file will have small icon overlay -- you can see it on phpunit.xml on your screenshot.
I may only suggest submitting a bug report / feature request to the Issue Tracker and hopefully it will be fixed soon: http://youtrack.jetbrains.net/dashboard/WI#tab=0 Having reproducible test case (e.g. standalone simple project or test suite from some opensource project) will be extremely useful.
In mean time you will have to create Run Configuration for each of such test files (or create one that will run ALL tests in ALL files in specific folder and subfolders)
BTW, My_Test_Database -- that class is highlighted which looks like PhpStorm is unable to find that class (cannot say more since you showed only part of the file) -- maybe that is the reason?
Thanks for Asking. It turned out that in my include path I had a phpunit version with DbUnit once I changed it, it worked fine. Thanks for the great support!!
PHP? JavaScript?
sorry php
Hi Torsten,
1. Run | Edit Configurations ... | Defaults -- edit default settings for the desired PHPUnit configuration type
2. Right click on file with PHPUnit test case (be it in Project View or in editor itself) and choose appropriate item from "Run" submenu (when right clicking in editor, the context matters -- you may see option to test specific method only if clicked while inside that specific method).
3. Temporary configuration will be created (icon will be faded) -- that's how it works: IDE has to have configuration entry to work with; but it will automatically be deleted when limit is reached (by default limit = 5 and you can change it in "Run | Edit Configurations... | Defaults")
Hi Andriy,
thanks. I dont 't get the right context menues i guess.
Attachment(s):
Bildschirmfoto 2012-07-23 um 15.00.30.png
Bildschirmfoto 2012-07-23 um 14.58.02.png
Please show whole file (including file name -- what icon is there?). Sounds like PhpStorm does not recognize it as PHPUnit test file.
Yes there is no icon indicating this
Attachment(s):
Bildschirmfoto 2012-07-23 um 15.26.32.png
From what I understand it is because you extend your test class from My_Test_Database and not from PHPUnit_Framework_TestCase directly. Apparently PhpStorm is unable to acknowledge that this is still PHPUnit test case (for whatever reason it may be -- maybe it cannot find that (or some other intermediate) class to make such decision -- don't know). Properly recognized test file will have small icon overlay -- you can see it on phpunit.xml on your screenshot.
I may only suggest submitting a bug report / feature request to the Issue Tracker and hopefully it will be fixed soon: http://youtrack.jetbrains.net/dashboard/WI#tab=0 Having reproducible test case (e.g. standalone simple project or test suite from some opensource project) will be extremely useful.
In mean time you will have to create Run Configuration for each of such test files (or create one that will run ALL tests in ALL files in specific folder and subfolders)
Ok thanks I see. Bugreporting is comming :-)
BTW, My_Test_Database -- that class is highlighted which looks like PhpStorm is unable to find that class (cannot say more since you showed only part of the file) -- maybe that is the reason?
It only occurs when extending from PHPUnit_Extensions_Database_TestCase:
http://youtrack.jetbrains.com/issue/WI-12261
Torsten,
Do you still have the issue?
Thanks for feedback!
Thanks for Asking. It turned out that in my include path I had a phpunit version with DbUnit once I changed it, it worked fine.
Thanks for the great support!!