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 198011 - Add support for PHPUnit annotations in completion, such as @dataProvider.
Summary: Add support for PHPUnit annotations in completion, such as @dataProvider.
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: PHPUnit (show other bugs)
Version: 7.0
Hardware: All All
: P4 normal with 2 votes (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-22 15:57 UTC by tuebernickel
Modified: 2013-01-12 16:55 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 tuebernickel 2011-04-22 15:57:48 UTC
The additional annotations of PHPUnit, such as @dataProvider should be available as autocomplete values within the "Test Files" section of the project. See http://www.phpunit.de/manual/3.5/en/appendixes.annotations.html for available annotations.

Annotations corresponding to the source code (such as @assert) should be available within the "Source Files" section of the project.

Product Version = NetBeans IDE 7.0 (Build 201104080000)
Operating System = Mac OS X version 10.6.7 running on x86_64
Java; VM; Vendor = 1.6.0_24
Runtime = Java HotSpot(TM) 64-Bit Server VM 19.1-b02-334
Comment 1 BullfrogBlues 2013-01-12 16:55:32 UTC
I think this feature has already been implemented in 7.2.1, though I'm not entirely sure what is meant by "autocomplete values within the "Test Files" section of the project".

Annotations are available in auto complete so:

/**
 * @data|<Ctrl><Spacebar>
 */

will result in:

/**
 * @dataProvider |methodName|
 */

However it would be nice to have autocomplete for the "provider method/function" aswell, so consider:

class TestClass extends PHPUnit_Framework_TestCase
  public setup() {}
  public testOne() {}
  public function get1(){ }
  public function provide2(){ }

  /**
   * @dataProvider |<Ctrl><Space>
   */

should give us completion for "get1" and "provide2". In other words, code completion for methods that are not tests and not phpunit reserved methods like assert*(), setup() and tearDown(), etc. 

Does that make sense?

Also, the `@dataProvider method` could also allow "Go to Declaration" so:

  public function provideSomething(){ }

  /**
   * @dataProvider provide|Something
   */

keystroke <Ctrl><B> (go to declation) on | will bring us to the provideSomething() method.

Maybe these should be separate feature requests?