Run single Test with Configuration

Hi

is it possible to run a single Test file, with a default configuration, without setting up a configuration for every test.

Thanks Torsten

12 comments
Comment actions Permalink

PHP? JavaScript?

0
Comment actions Permalink

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")

0
Comment actions Permalink

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
0
Comment actions Permalink

Please show whole file (including file name -- what icon is there?). Sounds like PhpStorm does not recognize it as PHPUnit test file.

0
Comment actions Permalink

Yes there is no icon indicating this



Attachment(s):
Bildschirmfoto 2012-07-23 um 15.26.32.png
0
Comment actions Permalink

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)

0
Comment actions Permalink

Ok thanks I see. Bugreporting is comming :-)

0
Comment actions Permalink

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?

0
Comment actions Permalink

It only occurs when extending from PHPUnit_Extensions_Database_TestCase:

http://youtrack.jetbrains.com/issue/WI-12261

0
Comment actions Permalink

Torsten,

Do you still have the issue?

Thanks for feedback!

0
Comment actions Permalink

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!!

0

Please sign in to leave a comment.