TS 72 PHP Projects

PHP Projects and Wizards Test Specification for NetBeans 7.2

Author: Vladimir Riha
Version: 1.0
Last update: 25th September 2013
Introduction: This specification provides usecases of Php project creation, Php Project properties customizing and Php Project actions in the NetBeans IDE

Mac OS specific details: To find Options on MacOS, go to Netbeans menu -> Preferences

Contents


Test suite: Create a new Php Project

Purpose: Check the Wizard for creation empty Php Project.
Setup: PHP engine and Apache 2.2 are configured. Apache 2.2 is installed to default location.

  1. Create an empty Project with default settings.
    1. In the Projects window, choose File > New Project.
    2. In the Categories list, select PHP. In the Projects area, choose PHP Application to create an empty project and click Next.
    3. Accept default values for Name and Location step. Press Finish button.
    • EXPECTED RESULT: Created Php project appears on Project tab. index.php opens in the source view. Project Sources are located in htdocs directory of Apache.
  2. Create empty Project with the given name
    1. In the Projects window, choose File > New Project.
    2. In the Categories list, select PHP, in the Projects area, choose PHP Application to create an empty project and click Next.
    3. Type Project Name myPhpProject. the rest fields use default values for Name and Location step, press Finish button.
    4. Repeat above steps for creating project with the same name.
    • EXPECTED RESULT: There should be the warning message: Source directory is already NetBeans project.
  3. Create empty Project with incorrect name
    1. In the Projects window, choose File > New Project.
    2. In the Categories list, select PHP, in the Projects area, choose PHP Application to create an empty project and click Next.
    3. For Name and Location step type Project Name myPhpProject*. Accept default values for the rest fields, press Cancel button.
    • EXPECTED RESULT: There should be warning message: Source directory is not a valid folder name.
  4. Create empty Project and put metadata into a separate directory
    1. In the Projects window, choose File > New Project.
    2. In the Categories list, select PHP, in the Projects area, choose PHP Application to create an empty project and click Next.
    3. Check "Put NetBeans metadata into a separate directory" checkbox and select some folder where to put metadata
    • EXPECTED RESULT: Created Php project appears on Project tab. Index.php opens in source view. Project Sources are located in the Source Folder and metadata are located in a separate directory.
  5. Create empty Project with renamed index.php file
    1. In the Projects window, choose File > New Project.
    2. In the Categories list, select PHP, in the Projects area, choose PHP Application to create an empty project and click Next.
    3. Accept default values for the rest fields, press Finish button.
    4. Rename index.php Index File to myindex.php.
    5. Invoke Properties for this PHP Application. Slect Run Configuration on Properties window. Press "Browse..." button for index file. Select myondex.php file. Press Select File button. Press OK.
    • EXPECTED RESULT: Created Php project appears on Project tab. Index file has new name myindex.php opens
  6. Create empty Project and choose copy location.
    1. In the Projects window, choose File > New Project.
    2. In the Categories list, select PHP, in the Projects area, choose PHP Application to create an empty project and click Next.
    3. Accept default values for the rest fields, press Next button.
    4. Set checkbox 'Copy files from Sources Folder to another location' on. Press Browse button and select path for copying. Press Finish button.
    • EXPECTED RESULT: Created Php project appears on Project tab. index.php opens in source view. Project Sources are located in the Sources Folder and have a copy in Copy Location.
  7. Create empty Project and set copy location to the doc root.
    1. In the Projects window, choose File > New Project.
    2. In the Categories list, select PHP, in the Projects area, choose PHP Application to create an empty project and click Next.
    3. Select NetBeansProjects directory for the Sources Folder combobox. Accept default values for the rest fields, press Next button.
    4. Set checkbox 'Copy files from Sources Folder to another location' on. Select htdocs\PhpProjectN for the Copy to Folder combobox. Press Finish button.
    • EXPECTED RESULT: Created Php project appears on Project tab. index.php opens in source view. Project Sources are located in the Project Folder and have a copy in htdocs directory of Apache.


Test suite: Create TodoList Sample Application

Purpose: Create the sample and work with it.
Setup: PHP engine, Apache 2.2 and MySQL data base are configured. Apache 2.2 is installed to default location.

  1. Create TodoList Sample
    1. In the Projects window, choose File > New Project.
    2. In the Categories list, select Samples>PHP. In the Projects area. Choose TodoList Sample Application to create the sample. Press Next.
    3. Name of Project is TodoListN. Press Finish.
    4. Folow the instruction in the appeared readme.html.
    • EXPECTED RESULT: Created TodoList Sample appears on Project tab. There should be opened readme.html in default browser. Finally, we can run the project.


Test suite: Check Properties of PHP Project

Purpose: Check Properties of PHP Project
Setup: PHP engine, Apache 2.2 and MySQL data base are configured. Apache 2.2 is installed to default location.

  1. Check Properties of php Project with default settings.
    1. In the Projects window, choose File > New Project.
    2. In the Categories list, select PHP. In the Projects area, choose PHP Project to create an empty project and click Next.
    3. Accept default values for Name and Location step, press Finish button.
    4. Created Php project appears on Project tab. Right click on the project and select Properties.
    • EXPECTED RESULT: Project Properties window appears. There are six Categories: Sources,Run Configuration, PHP Include Path, Ignored folders, Frameworks, PHPUnit, ApiGen, Formatting.
  2. Check Properties of php Project with default settings.
    1. Create a PHP Project with default settings. (Source folder is htdocs folder of Apache, Copy folder is not specified.)
    2. Right click on the project and select Properties. Select Sources node in the Categories tree.
    3. Set check box 'Copy files from Sources Folder to another location' on. Expand combobox and select htdocs\PhpProjectN+1 folder. Press Ok button.
    • EXPECTED RESULT: Project Properties window appears. There are six Categories: Sources,Run Configuration, PHP Include Path, Ignored folders, PHPUnit, PHPDocm, Formatting.


Test suite: PHP Project from remote server

Purpose: Create PHP Project with remote server; FTP
Setup: PHP engine, Apache 2.2 and MySQL data base are configured. Apache 2.2 is installed to default location.

  1. Create PHP Project from remote sources
    1. In the Projects window, choose File > New Project.
    2. In the Categories list, select PHP. In the Projects area, choose PHP Project from Remote Server
    3. Accept default values for Name
    4. set project url to your local folder
    5. select manage remote configuration
    6. use ftp connection
    7. enter credentials, see hw&os configuration for php testing server on Jupiter
    8. set initial directory to /var/www/PHPTesting/remoteConfigurationProject
    9. Created Php project appears on Project tab and sources will be downloaded
    • EXPECTED RESULT: sources are downloaded. You can see log. verify that data has been downloaded.
  2. Check Properties of php Project From Remote Server
    1. Right click on the project from previous testcase and select Properties.
    2. Select Run Configuration
    • EXPECTED RESULT: Verify that configuration matches to entries you entered before and upload files is set on save
  3. Create PHP Project with remote server, SFTP without public key
    1. repeat first testcase of this testsuite using sftp connection without providing public key
  4. Create PHP Project with remote server, SFTP with public key
    1. repeat first testcase of this testsuite using sftp connection and providing public key without passphrase
  5. Create PHP Project with remote server, SFTP with public key with passphrase and without password
    1. repeat first testcase of this testsuite using sftp connection and provide public key with passphrase and without password



Test suite: PHP Built-in web server

Setup: PHP 5.4 needed

  1. Create and run PHP Project with Built-in web server
    1. In the Projects window, choose File > New Project.
    2. In the Categories list, select PHP. In the Projects area, choose PHP Application
    3. Accept default values for Name and location
    4. In Run Configuration, select "PHP Built-in web server" for Run As field
    5. Keep other values intact, press Finish
    6. Create new PHP file called router.php
    7. Paste in it code from PHP documentation and save it
<?php
// router.php
if (preg_match('/\.(?:png|jpg|jpeg|gif)$/', $_SERVER["REQUEST_URI"]))
    return false;    // serve the requested resource as-is.
else { 
    echo "<p>Welcome to PHP</p>";
}
?>
    1. Go to project Properties | Run Configuration and there select Router Script to point to the router.php
    2. Run project
    • EXPECTED RESULT: New web page is opened in browser with message "Welcome to PHP"


Test suite: PHP Built-in web server for multiple projects

Setup: PHP 5.4 needed

  1. Create and run another PHP Project with Built-in web server
    1. Create new project like in previous test, only modify the message in router script
    2. Run this project (while the original is still running)
    • EXPECTED RESULT: The first project is stopped and second one opens in browser again with different message
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