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 - "Fix Uses in Current Namespace" and PHPUnit - @expectedException
Summary: "Fix Uses in Current Namespace" and PHPUnit - @expectedException
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Brejla
Depends on:
Reported: 2012-11-22 14:46 UTC by dagguh
Modified: 2015-09-14 14:09 UTC (History)
1 user (show)

See Also:
Exception Reporter:

IDE log (607.40 KB, text/plain)
2012-11-22 14:46 UTC, dagguh

Note You need to log in before you can comment on or make changes to this bug.
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: :)
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.