TS 67 PHP Code Completion

Revision as of 16:15, 23 February 2011 by Vriha (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)

PHP Editor Test Specification for NetBeans 6.7

Author: Filip Zamboj
Version: 1.0
Introduction: This specification provides usecases for PHP editor in the NetBeans IDE
Comments:

Contents


Test suite: Code Completion

Purpose: Check that code completion works properly in PHP code and HTML for PHP source and PHP web page.
Prerequisites: a PHP project is created in the Netbeans IDE.

  1. Create a PHP source file.
    1. In the main menu, choose File > New File...
    2. In the Categories list, select Scripting. In the File Types list, choose PHP File. Click Next.
    3. Accept default values by pressing Finish button.
    • EXPECTED RESULT: A new PHP web page is created and opened in the editor.
  2. Verify automatic code completion invocation.
    1. In PHP source, type $.
    • EXPECTED RESULT: Code completion is invoked automatically - a list of available variables appears.
  3. Verify local variable code completion.
    1. Create a PHP function.
    2. Declare a variable in the function.
    3. Type several first symbols of the variable name and invoke code completion.
    • EXPECTED RESULT: Code completion appears and the variable name is among suggestions.
  4. Verify global variable code completion.
    1. Create a PHP function.
    2. Declare a global variable.
    3. Type several first symbols of the variable name and invoke code completion.
    • EXPECTED RESULT: Code completion appears and the variable name is among suggestions.
  5. Verify variable from included file code completion.
    1. Include an other PHP file into PHP source.
    2. Open that PHP source and create a global variable there.
    3. Create a PHP function in the first source.
    4. Inside that function, type several first symbols of the variable name and invoke code completion.
    5. Choose that variable in the list and press Enter.
    • EXPECTED RESULT: Code is completed properly. No require or include directive is auto-generated.
  6. Verify variable from required file code completion.
    1. Add an other PHP file into PHP source using the require directive.
    2. Open that PHP source and create a global variable there.
    3. Create a PHP function in the first source.
    4. Inside that function, type several first symbols of the variable name and invoke code completion.
    5. Choose that variable in the list and press Enter.
    • EXPECTED RESULT: Code is completed properly. No require or include directive is auto-generated.
  7. Verify code completion inside the identifier.
    1. Place the caret inside of existing PHP identifier.
    2. Invoke code completion.
    • EXPECTED RESULT: Code completion appears and the list of suggestions corresponds to the beginning of the identifier.
  8. Verify documentation hints for built-in identifiers.
    1. Invoke code completion for a whitespace.
    2. Select a built-in identifier in the list (like $GLOBALS, $_ENV)
    • EXPECTED RESULT: In the details code completion view, a description of the identifier appears.
  9. Verify documentation hints for keywords.
    1. Invoke code completion for a whitespace.
    2. Select a keyword in the list (like extends, if).
    • EXPECTED RESULT: In the details code completion view, a description of the keyword appears.
  10. Verify keywords code completion.
    1. Type the beginning of a keyword in a situation appropriate for its usage.
    2. Invoke code completion.
    • EXPECTED RESULT: Code completion appears and the keyword is among suggestions.
  11. Verify code completion with a single option.
    1. Type the beginning of a identifier so that there is only one option for code completion.
    2. Invoke code completion.
    • EXPECTED RESULT: Identifier is instantly completed without any popup windows.
  12. Verify JavaDoc window.
    1. Create a PHP function.
    2. Add some JavaDoc to that function. Don't save the source.
    3. In some other place, type the beginning of that function name and invoke code completion.
    4. Select that function in the popup window.
    • EXPECTED RESULT: Just entered JavaDoc is shown in the JavaDoc window of code completion.
  13. Verify code completion after EXTENDS.
    1. Define Foo class.
    2. Type "class MyClass extends F".
    3. Invoke code completion.
    • EXPECTED RESULT: Code completion appears and Foo class is shown. No any other identifiers are shown.
  14. Verify that require directive is automatically added.
    1. Currently not supported, see issue #195851
    2. Create a function in PHP file.
    3. In another PHP file, invoke code completion so that that function is available.
    4. Select that function and press Enter.
    • EXPECTED RESULT: code is completed with that function name, and require directive is added for the corresponding class.
  15. Verify code completion in // comments.
    1. Create // style comment .
    2. Invoke code completion at that line after //.
    • EXPECTED RESULT: Code completion doesn't appear. It shouldn't be available in comments.
  16. Verify code completion in /* */ comments.
    1. Create /* */ style comment .
    2. Invoke code completion inside of that comment.
    • EXPECTED RESULT: Code completion doesn't appear. It shouldn't be available in comments.
  17. Verify code completion in /** */ comments.
    1. Create /** */ comment .
    2. Invoke code completion inside of that comment.
    • EXPECTED RESULT: Code completion shows a list of JavaDoc tags (like @abstract).



Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo