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 238306 - cannot run focused test method unless file name ends with "Test.php"
Summary: cannot run focused test method unless file name ends with "Test.php"
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: PHPUnit (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Tomas Mysik
URL:
Keywords:
: 239081 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-11-13 11:23 UTC by xadadax
Modified: 2016-04-13 18:46 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 xadadax 2013-11-13 11:23:29 UTC
Attempting to "Run Focused Test Method" within a unit test results in "no test method found" unless the file name ends with Test.php 

e.g.
create two identical files my.test.php and myTest.php that both contain

<?php
class MyTest extends PHPUnit_Framework_TestCase
{
    public function testThisThing()
    {
        $this->assertTrue(TRUE);
    }
}


trying to "Run Focused Test Method" will work in the myTest.php file but will not work in the my.test.php file

I am working with a large existing codebase that has older conventions so that simply renaming all the tests will be time consuming and in my opinion should not be required.
Comment 1 xadadax 2013-11-14 10:53:14 UTC
having looked into things some more, I think that the issue raised may be slightly different. I have set the phpunit suffix in the phpunit.xml file like this :

    <testsuite name="MyApplication">
        <directory suffix=".test.php">./Test/Application</directory>
        <directory suffix=".test.php">./Test/Libraries</directory>
    </testsuite>

when Netbeans executes a full set of tests this file is read and all the tests run ok. 

However when I attempt to run focused test method it appears that this file is not parsed so the phpunit default of *Test.php is assumed.
Comment 2 mmolda 2013-11-14 15:59:24 UTC
Reproducible. 
"Run Focused Test Method" is working only in files which names ends with Test.php.

Product Version: NetBeans IDE Dev (Build 201311140002)
Java: 1.7.0_45; Java HotSpot(TM) Client VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Windows 7 version 6.1 running on x86; Cp1250; en_US (nb)
Comment 3 Tomas Mysik 2013-11-15 06:31:40 UTC
Well, we do not parse any XML config and simply use just "Test" suffix as it is the default (and it works fine from NB 6.7 ;). Not sure if we can do anything with this issue easily but I will have a look at it.

BTW this issue is more enhancement than a bug...

Thanks.
Comment 4 xadadax 2013-11-25 14:13:26 UTC
Thanks for the comments Tomas,
I have changed the issue type to enhancement.
Comment 5 mmolda 2013-12-03 17:15:24 UTC
*** Bug 239081 has been marked as a duplicate of this bug. ***
Comment 6 alderaic 2016-04-13 18:46:01 UTC
Any updates on this issue?
I have a complete series of test cases, and right now I use the rerun failed tests as a way of not running everything,
Not sure why the system would understand that I want to run a test at that point in the file I have opened and then look for a filename pattern?
maybe change the design to popup for a method name to test?