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 268992 - Allow full use of phpunit.xml testsuites
Summary: Allow full use of phpunit.xml testsuites
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: PHPUnit (show other bugs)
Version: Dev
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-15 20:05 UTC by twifty
Modified: 2016-11-16 06:58 UTC (History)
0 users

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 twifty 2016-11-15 20:05:41 UTC
Hopefully this is a quick fix for anybody familiar with the source.

Current problem:
netbeans does not use the testsuites defined in a custom phpunit.xml file. This can be altered by using a custom testsuite class, but, we lose all of the netbeans api interaction. For example, running a single file or method.

Insight:
When using the built in NetBeansSuite.php, the CLI is called with a --run= argument which lists either all test folders currently configured in the IDE, or a single *Test.php file. The suite then uses these values to initialize a PHPUnit_Framework_TestSuite. When using a custom suite, it would be helpful to have these values to narrow the scope of the test(s) to perform.

Proposed solution:
Don't strip the argv arguments when the IDE is configured to use a custom testsuite. This will not cause a BC issue.
Comment 1 eviweb 2016-11-16 06:58:13 UTC
Hi everybody,

I confirm that a full support of the phpunit.xml configuration file would be a useful enhancement.

A typical use case I quite often encounter, and where I find this very annoying, is when in a project I want to keep some spikes (cf. http://agiledictionary.com/209/spike/) that are neither unit tests nor integration tests.

For clarity, I obviously add a Spike suffix instead of a Test suffix to the test case, which does not currently work in NetBeans.

The only way I found to support this use case, was to develop my own test suite provider which can be found there: https://github.com/BrickieToolShed/netbeans-phpunit-support
Don't hesitate to give it a look, the code is pretty simple.

But as @twifty said you lose not all but a great part of the NetBeans api interaction.

I think NetBeans should still provide a "Test case Lookup" when no phpunit.xml file is set but should give it priority when it is.

Then there should not be any differences between running phpunit through NetBeans and the standalone way.

Best regards

Eric