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 222596

Summary: "Fix Uses in Current Namespace" and PHPUnit - @expectedException
Product: php Reporter: dagguh
Component: EditorAssignee: Ondrej Brejla <obrejla>
Status: NEW ---    
Severity: normal CC: jmglsn
Priority: P3    
Version: 8.1   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: IDE log

Description dagguh 2012-11-22 14:46:37 UTC
<?
class FooTests extends PHPUnit_Framework_TestCase {

    /**
     * @test
     * @expectedException \foo\bar\BazException
     */ 
     public function testStuff() {
        // ...
    }

}
?>

"Fix Uses in Current Namespace" will import the BazException and shorten the @expectedException \foo\bar\BazException to @expectedException BazException. It is all good for me, but PHPUnit is not that smart and expects \BazException (from global namespace).

While I am aware of the fact, that it is PHPUnits fault, it is really troublesome and I am not sure whether they will fix it or not.
I enjoy this feature for @return, @param and @var annotations, but I'd like to blacklist @expectedException.


Product Version = NetBeans IDE Dev (Build 201210280001)
Operating System = Linux version 3.2.0-33-generic-pae running on i386
Java; VM; Vendor = 1.7.0_09
Runtime = OpenJDK Client VM 23.2-b09
Comment 1 dagguh 2012-11-22 14:46:45 UTC
Created attachment 128268 [details]
IDE log
Comment 2 Ondrej Brejla 2012-11-22 14:51:42 UTC
I'll think about it...but as you wrote, it's definitely PHPUnits fault :(
Comment 3 dagguh 2012-11-22 17:02:24 UTC
I'm gonna leave this here: https://github.com/sebastianbergmann/phpunit/issues/730 :)
Comment 4 jmglsn 2015-09-14 14:09:09 UTC
PHPUnit is not going to fix that, as it's going to blow up phpUnit runtime.
So please add an option to make this behavior depending on an option flag.