TS 67 PHP Miscellaneous

PHP Editor Test Specification for NetBeans 6.7

Author: Mikhail Matveev, revision for 6.7 by Filip Zamboj, new features for 7.0 by Lada Riha
Version: 1.0
Introduction: This specification provides usecases for PHP editor in the NetBeans IDE
Comments: Draft

Contents



Test suite: Run file without project

Purpose: Check that you can run and debug file without project
Prerequisites: some PHP file

  1. Test running file without project .
    1. In the main menu, choose File > Open File... And open your php file
    2. Right click in the file content (text editor), then Run File (SHIFT + F6)
    • EXPECTED RESULT: Similiar dialog as on the picture below appears and the file has correct output - you can see the output in Output Window

File:Run-file-1.png

Test suite: Debug file without project

  1. Test debugging file without project .
    1. In the main menu, choose File > Open File... And open your php file
    2. Right click in the file content (text editor), then Debug File (CTRL + SHIFT + F5)
    • EXPECTED RESULT: Similiar dialog as on the picture below appears.

File:Run-file-2.png

Test suite: Framework enhancements

  1. Framework enhancements.
    1. In the main menu, choose File > New Project... And create new php project with Zend Framework.
    • EXPECTED RESULT: The project should have a similiar file structure with the same icons used as on the picture below, files has different icons depending on their purpose.

File:Php-improvements.png

Test suite: Refactoring

Prerequisites: a PHP project is created in the Netbeans IDE.

  1. Rename refactoring inside project
    1. Create two PHP files, called them for example fileA and fileB.
    2. In fileA, define some function
    3. In fileB, use include directive to include fileA
    4. Call the functions (declared in fileA) in fileB.
    5. Place cursor inside this call and press Ctrl+R. New Rename dialog will be opened, type some new name and press Preview
    6. Refactoring window appears so you can check all changes and matches with the function you want to rename.
    7. Review matches and hit Do refactoring to rename this function
    • EXPECTED RESULT: All occurences of the function are renamed. Try the same for variables and constants as well
  1. Class rename refactoring
    1. Create two PHP files, called them for example fileA and fileB.
    2. In fileA, define some class and outside that class, you can paste following code:
class Foo{
    function Foobar() {  
    }
 }
$bar = new Foo();
    1. In fileB, include fileA and use the class somehow:
$bar = new Foo();
    1. In fileA, right click on class and Refactor|Safely remove
    • EXPECTED RESULT: Class is removed from fileA

Test suite: Generate PhpDoc

Purpose: Check that PhpDoc documentation works
Prerequisites: a PHP project is created in the Netbeans IDE, PhpDoc is installed.

  1. Generate PhpDoc
    1. Open Tools|Options|PHP to check that PhpDoc installation was recognized and that the PhpDoc script has been found. If not, find it manually.
    2. In the Project Window, use right click on your project to invoke popup menu and select Generate PhpDoc
    3. In the first run, Netbeans will ask you to specify target directory for the documentation, Select a directory dialog is shown
    4. Select directory and hit OK
    5. Check Output window, there should be information about created documentation
    6. Checkout project Properties, there should be section called PhpDoc. Here, you can change the output directory
    • EXPECTED RESULT: Documentation is created in selected directory

Test suite: Aliases

Purpose: Check that aliases works in php file
Prerequisites: a PHP project is created in the Netbeans IDE.

  1. Aliases
    1. Create new php file and declare function called reallyLongNameForUselessFunction.
    2. In the lines below, type following:
use reallyLongNameForUselessFunction as shortName;
    1. Now, start typing shortN and invoke code completion. Whole name should be completed.
    • EXPECTED RESULT: Hold Ctrl and left click on calling of shortName, cursor should be moved to the line with reallyLongNameForUselessFunction declaration.

Test suite: Type Hierarchy View

Purpose: Check that Type Hierarchy View works
Prerequisites: a PHP project is created in the Netbeans IDE.

  1. Type Hierarchy View
    1. Create new php file and declare a class called Foo.
    2. In the same file, declare new class called Bar that extends class Foo
    3. Invoke popup menu and select Navigate|Php Type Hierarchy
    4. New window called Php Type Hierarchy view is opened. It contains 2 classes and their relations to each other.

image:Hv.PNG

    1. Use the 2 buttons at the bottom to switch the view
    • EXPECTED RESULT: Subtype hierarchy displays class and its subclasses or interface and the classes that implement it. Supertype hierarchy displays classes that are extended and interfaces that are implemented .

Test suite: Mark Occurrences

Purpose: Check that occurrences of PHP identifier highlighted when of the identifiers is selected.
Prerequisites: a PHP project is created in the Netbeans IDE.

  1. Create a PHP web page.
    1. In the main menu, choose File > New File...
    2. In the Categories list, select Scripting. In the File Types list, choose PHP Web Page. Click Next.
    3. Accept default values by pressing Finish button.
    4. Copy/paste a large PHP code peace into the editor.
    • EXPECTED RESULT: A new PHP web page is created and opened in the editor. The code is added there.
  2. Verify local variable occurrences marking.
    1. Create several PHP functions.
    2. Introduce a global variable.
    3. Introduce a variable with the same name in each of these functions.
    4. Add operators which use each of these variables.
    5. Place the cursor onto usage one of these variables.
    • EXPECTED RESULT: Definition and usages of this variable are highlighted. Definition and usages of other variables aren't.
  3. Verify function occurrences marking.
    1. Create a PHP function.
    2. Add several calls of that function, both inside and outside of its code.
    3. Place the cursor onto one of these calls.
    • EXPECTED RESULT: Definition and calls of this function are highlighted.
  4. Verify parameter occurrences marking.
    1. Create a PHP function with a parameter.
    2. Use that parameter in the function body.
    3. Place the cursor onto one of these usages.
    • EXPECTED RESULT: Definition and usages of this parameter are highlighted.


Test suite: HTML Palette

Purpose: Check adding the HTML Palette components to PHP source.
Prerequisites: a PHP project is created in the Netbeans IDE.

  1. Create a PHP web page.
    1. In the main menu, choose File > New File...
    2. In the Categories list, select Scripting. In the File Types list, choose PHP Web Page. Click Next.
    3. Accept default values by pressing Finish button.
    • EXPECTED RESULT: A new PHP web page is created and opened in the editor. Palette window on the right is opened and displays HTML and HTML Forms groups.
  2. DnD Table HTML component to HTML code.
    1. DnD Table HTML component to the editor, not into PHP code.
    2. In the "Insert Table" dialog, press OK.
    • EXPECTED RESULT: HTML tags added to DnD position. They correspond to visual representation of Table HTML component in the "Insert Table" dialog.
  3. DnD Table HTML component to PHP code.
    1. DnD Table HTML component to the editor, into PHP code.
    2. In the "Insert Table" dialog, press OK.
    • EXPECTED RESULT: HTML tags added to DnD position. They correspond to visual representation of Table HTML component in the "Insert Table" dialog. Editor lines are marked with red, and tooltip reads "Syntax error".
  4. DnD Table HTML component outside of editor view.
    1. DnD Table HTML component to the Projects window.
    2. DnD Table HTML component to the Navigator window.
    • EXPECTED RESULT: In both cases, mouse cursor indicates that DnD is impossible.
  5. DnD big Table HTML component to HTML code.
    1. DnD Table HTML component to the editor.
    2. In the "Insert Table" dialog, specify large values for rows and columns (like 1000), change values of other fields and press OK.
    • EXPECTED RESULT: After reasonable time (few seconds), HTML tags added to DnD position. They correspond to the visual representation of Table HTML component in the "Insert Table" dialog (with made changes).
  6. DnD Table HTML component with given parameters to HTML code.
    1. DnD Table HTML component to the editor.
    2. In the "Insert Table" dialog, change values of each field and press OK.
    • EXPECTED RESULT: HTML tags added to DnD position. They correspond to the visual representation of Table HTML component in the "Insert Table" dialog (with made changes).
  7. Add Table HTML component with given parameters to HTML code using double-click.
    1. Place the cursor to some position in editor.
    2. Double-click Table HTML component.
    3. In the "Insert Table" dialog, change values of each field and press OK.
    • EXPECTED RESULT: HTML tags added to DnD position. They correspond to the visual representation of Table HTML component in the "Insert Table" dialog (with made changes).
  8. Undo adding Table HTML component to HTML code.
    1. DnD Table HTML component to the editor.
    2. In the "Insert Table" dialog, change values of each field and press OK.
    3. In the main menu, choose Edit -> Undo.
    • EXPECTED RESULT: HTML tags added to DnD position, but reverted after Undo.
  9. DnD Form HTML component with given parameters to HTML code.
    1. DnD Form HTML component to the editor.
    2. In "Insert Table" dialog, change values of each field and press OK.
    • EXPECTED RESULT: HTML tags added to DnD position. They correspond to the visual representation of Form HTML component in the "Insert Form" dialog (with made changes).
  10. DnD other HTML components with given parameters to HTML code.
    1. Same as previous, for other components in HTML Palette.
    • EXPECTED RESULT: HTML tags added to DnD position. They correspond to the visual representation of an HTML component in the insert dialog (with made changes).



Test suite: Navigation

Purpose: Check Navigation in PHP code.
Prerequisites: a PHP project is created in the Netbeans IDE.

  1. Create a PHP web page.
    1. In the main menu, choose File -> New File...
    2. In the Categories list, select Scripting. In the File Types list, choose PHP Web Page. 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. Navigate to a specified line.
    1. In the editor popup menu, choose Navigation -> Line...
    2. Type a valid line number and press GoTo.
    • EXPECTED RESULT: The caret is moved to the specified line.
  3. Navigate to an invalid line.
    1. In the editor popup menu, choose Navigation -> Line...
    2. Type a line number which is greater that number of lines in the file and press GoTo.
    • EXPECTED RESULT: The caret is moved to the end of file.



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