TS 73 PHP Composer Support

PHP Composer Support for NetBeans 7.3

Author: Martin Kanak
Version: 1.0
Last Update: 12th October 2012
Introduction: This specification provides usecases for PHP editor in the NetBeans IDE
Comments: Note that code completion is always being developed and features changed. This TS contains basic code completion features that have to work. All other features will be/are covered by functional and unit tests as they are easily maintained and configured. List of covered topics by automated tests will be added to the list of TSs once the overview is complete.

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

Contents


TestSuite: Composer Basic Support

Setup: Composer is installed and configured.

  1. Verify Composer Init
    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.
    4. Right click on project and select Composer > Init
    • EXPECTED RESULT: composer.json file was generated.
  2. Verify Composer Install
    1. Prerequisity: Project with generated composer.json file (from testcase no.1 Verify Composer Init)
    2. Open the composer.json file
    3. Delete all code from this file and insert the following code:
{
    "require": {
        "monolog/monolog": "1.0.*"
    }
}
    1. Save composer.json file after inserting code
    2. Right click on project and select Composer > Install
    • EXPECTED RESULT: You can see output which is similar to the one on screenshot.

      File:Composer_install.png
  1. Verify Composer Update
    1. Prerequisity: Project from testcase no.2 Verify Composer Install
    2. Open the composer.json file
    3. Delete the line with "monolog/monolog": "1.0.*", so now you have this code in source of composer.json:
{
    "require": {
        
    }
}
    1. Save composer.json file
    2. Right click on project and select Composer > Update
    • EXPECTED RESULT: You can see output which is similar to the one on screenshot.

      File:Composer_update.png
  1. Verify Composer Validate
    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.
    4. Right click on project and select Composer > Init
    5. composer.json file was generated
    6. Right click on project and select Composer > Validate
    • EXPECTED RESULT: You can see output which is similar to the one on screenshot.

      File:Composer_validate1.png
    1. Now delete the second line from composer.json file (on this line there should be something like this "name": "vendor/php-project1", -> so delete it)
    2. Save composer.json file
    3. Again right click on project and select Composer > Validate
    • EXPECTED RESULT: You can see output which is similar to the one on screenshot.

      File:Composer_validate2.png
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