This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 180704 - Give better options when setting up tests
Summary: Give better options when setting up tests
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: PHPUnit (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 normal (vote)
Assignee: issues@php
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-14 20:06 UTC by dmuir
Modified: 2010-12-08 01:35 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dmuir 2010-02-14 20:06:26 UTC
When I set up a test folder with existing sources, it went ahead and built test cases for pretty much every single file in my source tree, even though there were tests present. It would good to have a bit more control over this. 

Basically, allow me to set up folder mappings, whitelists, and blacklists before generating unit tests. Also give me the option of not opening new tests. If you accidentally tell it to create unit tests for a folder with 100+ files, it can easily crash Netbeans.
Comment 1 Tomas Mysik 2010-02-15 03:41:46 UTC
(In reply to comment #0)
> Basically, allow me to set up folder mappings,

Unlikely to happen, sorry.

> whitelists, and blacklists
> before generating unit tests.

XML configuration cannot help in this case? I don't know it but I would expect so.

> Also give me the option of not opening new tests.
> If you accidentally tell it to create unit tests for a folder with 100+ files,
> it can easily crash Netbeans.

This can be done.
Comment 2 dmuir 2010-02-17 20:39:49 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > Basically, allow me to set up folder mappings,
> 
> Unlikely to happen, sorry.

Bummer.

> 
> > whitelists, and blacklists
> > before generating unit tests.
> 
> XML configuration cannot help in this case? I don't know it but I would expect
> so.

I mean for auto-generation of unit tests.
eg. right click on "Source Files" -> Tools -> Create PHPUnit Tests
would be nice to be given an a window where you can select what files/folders to create unit tests for.

> 
> > Also give me the option of not opening new tests.
> > If you accidentally tell it to create unit tests for a folder with 100+ files,
> > it can easily crash Netbeans.
> 
> This can be done.

Thanks.
Comment 3 Tomas Mysik 2010-02-18 02:05:08 UTC
(In reply to comment #2)
> I mean for auto-generation of unit tests.
> eg. right click on "Source Files" -> Tools -> Create PHPUnit Tests
> would be nice to be given an a window where you can select what files/folders
> to create unit tests for.

Again, isn't it possible to define any whilelist/blacklist in PHPUnit XML configuration?
Moreover, one can select only those folders and/or files for which unit tests should be generated.
Comment 4 Filip Zamboj 2010-09-15 12:36:55 UTC
batch reassigning
Comment 5 schkovich 2010-12-08 01:35:08 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > I mean for auto-generation of unit tests.
> > eg. right click on "Source Files" -> Tools -> Create PHPUnit Tests
> > would be nice to be given an a window where you can select what files/folders
> > to create unit tests for.
> 
> Again, isn't it possible to define any whilelist/blacklist in PHPUnit XML
> configuration?
> Moreover, one can select only those folders and/or files for which unit tests
> should be generated.

Sorry to interrupt. :)

I agree with Thomas that one can select in Files or Projects window, folders/files for which unit tests should be generated.

However, as far as I can see, there is no option in PHPUnit XML configuration [1] to whilelist/blacklist folders/files for which unit tests should be generated. There is option to include/exclude files/folders from code coverage which sounds similar.

Finally I have to agree with reporter that it will be nice to have something similar to refactoring preview: a list of folders/files with checkboxes to select folders/files to create test skeletons. Parent folder could be dependent on folder selected, e.g. if the user right clicks on src/AcmeModel in preview window only content of src/AcmeModel will be shown. Comparing to using ctrl+click in Projects or Files window, sounds much easier and gives more control. 

[1] http://www.phpunit.de/manual/3.6/en/appendixes.configuration.html