TS 69 PHP Symfony

PHP Symfony Framework Support Test Specification for NetBeans 6.9

Author: Filip Zamboj, updates Vladimir Riha
Version: 1.1
Last update: 21st November 2011
Introduction: PHP Symfony Framework Support Test Specification
Documents: See List of necessary 3rd party Software Note: Automatic recognition won't work because the URL pear.symfony-project.com is not working...

Contents


Test suite: Symfony PHP Project

Note: How to install symfony is to be found here. Don't install yet

  1. Create New Symfony PHP Project
    1. In the Projects window, choose File > New Project.
    2. In the Categories list, select PHP. In the Projects area, choose PHP Project
    3. Accept default values for Name and Location
    4. press next
    5. enable Symfony PHP Web Framework
    6. accept default values (Close project wizard Issue 168832)
    • EXPECTED RESULT: verify that error on the bottom of the panel appears. It should indicate it didn't find symfony script
Linux - automatic recognition
  1. Linux - automatic recognition
    1. Install symfony as a pear package. Note: you need to allow more than 256MB of memory for php command line script. Settings to be found in something/cli/php.ini where something stands for the path to php
ubuntu example: 
$ sudo pear channel-discover pear.symfony-project.com
[Sudo] password for felipee: 
Adding Channel "pear.symfony-project.com" succeeded
Discovery of channel "pear.symfony-project.com" succeeded
$ sudo pear install symfony/symfony-1.2.8
downloading symfony-1.2.8.tgz ...
Starting to download symfony-1.2.8.tgz (2,695,461 bytes)
..................................................done: 2,695,461 bytes
install ok: channel://pear.symfony-project.com/symfony-1.2.8
    1. open Tools -> Options -> PHP -> Symfony -> search
    • EXPECTED RESULT: script is found and path appears in text field
    1. try to create symfony project and verify expected result and the end of this testcase
    • EXPECTED RESULT: Symfony project is created and it's icon is showing usage of Symfony framework. Invoke project context menu and you should find symfony -> clear cache and/or symfony -> run command
    1. uninstall symfony
ubuntu example: 
$ sudo pear uninstall symfony/symfony-1.2.8
uninstall ok: channel://pear.symfony-project.com/symfony-1.2.8
Linux - manual settings
  1. Linux - manual settings
    1. Install symfony manually - what basically means download package or checkout from svn
    2. open Tools -> Options -> PHP -> Symfony -> Browse
    3. provide path to symfony/data/bin/symfony
    • EXPECTED RESULT: path should be accepted
    1. try to create symfony project and verify expected result and the end of this testcase
    • EXPECTED RESULT: Symfony project is created and it's icon is showing usage of Symfony framework. Invoke project context menu and you should find symfony -> clear cache and/or symfony -> run command
Windows - automatic recognition
  1. Windows - automatic recognition
    1. install pear for windows if you don't have yet How To
c:\wamp\bin\php\php5.2.9-2>pear channel-discover pear.symfony-project.com
Adding Channel "pear.symfony-project.com" succeeded
Discovery of channel "pear.symfony-project.com" succeeded

c:\wamp\bin\php\php5.2.9-2>pear install symfony/symfony-1.2.8
downloading symfony-1.2.8.tgz ...
Starting to download symfony-1.2.8.tgz (2,695,461 bytes)
.........done: 2,695,461 bytes
install ok: channel://pear.symfony-project.com/symfony-1.2.8
    1. open Tools -> Options -> PHP -> Symfony -> search
    • EXPECTED RESULT: script is found and path appears in text field. If not, then verify you have path to PEAR in %PATH% system variable
    1. try to create symfony project and verify expected result and the end of this testcase
    • EXPECTED RESULT: Symfony project is created and it's icon is showing usage of Symfony framework. Invoke project context menu and you should find symfony -> clear cache and/or symfony -> run command
Windows - manual settings
  1. Windows - manual settings
    1. repeat steps for manual path entering for Linux, note: use only paths without spaces!
    2. provide path to symfony/data/bin/symfony.bat
    • EXPECTED RESULT: path should be accepted
    1. try to create symfony project
    • EXPECTED RESULT: Symfony project is created and it's icon is showing usage of Symfony framework. Invoke project context menu and you should find symfony -> clear cache and/or symfony -> run command

Everything below is not OS specific.

OS nonspecific tests

  1. Symfony Project containing symfony sources
    1. Create Rent A Flat Sample project, close the project
    2. Open closed project again
    3. from command line call
    • EXPECTED RESULT: project should be recognized as symfony project. Verify by invoking project context menu and found symfony-> run command and/or symfony -> clear cache. The project folder tree will be as the one above but including symfony sources in lib/vendor/


  1. Create Rent A Flat Sample
    1. In the Projects window, choose File > New Project.
    2. In the Categories list, select Samples>PHP. In the Projects area. Choose Rent A Flat (Symfony) to create the sample. Press Next.
    3. Name of Project is RentAFlat-SymfonyN where N is used when Project with the same name already exists in default project folder and N > 0.
    4. Press Finish.
    5. Folow the instruction in the appeared readme.html.
    • EXPECTED RESULT: Created Rent A Flat Sample appears on Project tab. There should be opened readme.html in default browser.

Testsuite: Use Symfony commands

Use Filter on Symfony Commands

    1. create empty symfony project
    2. run Symfony -> Clear Cache from project node context menu (right click on project node)
    • EXPECTED RESULT: following output should appear in output window:
>>   Cache directory "/.../NetBeansProjects/RentAFlat-Symfony6/cache" does not exist.  

Use Filter on Symfony Commands

    1. invoke context menu on project node
    2. run Symfony -> Run Command
    3. type to filter generate
    • EXPECTED RESULT: Only tasks that correspond to filter are present in matching tasks window. There is task description below matching tasks window

Invoke Symfony Command

    1. check Keep this dialog opened
    2. invoke generate:module task with parameters 'frontend home'
    • EXPECTED RESULT: Run Symfony Command dialog will be opened. You should see similar output in output window and following folder structure of apps/frontend/modules/home should be created according to the example below.
OUTPUT:
>> dir+      /var/www/PhpProject140/apps/frontend/modules/home/templates
>> file+     /var/www/PhpProject140/apps/fro...home/templates/indexSuccess.php
>> dir+      /var/www/PhpProject140/apps/frontend/modules/home/actions
>> file+     /var/www/PhpProject140/apps/fro.../home/actions/actions.class.php
>> file+     /var/www/PhpProject140/test/fun...al/frontend/homeActionsTest.php
>> tokens    /var/www/PhpProject140/test/fun...al/frontend/homeActionsTest.php
>> tokens    /var/www/PhpProject140/apps/fro...home/templates/indexSuccess.php
>> tokens    /var/www/PhpProject140/apps/fro.../home/actions/actions.class.php

FOLDER STRUCTURE: 
$application/modules tree 
.
|-- actions
|   `-- actions.class.php
`-- templates
    `-- indexSuccess.php
  1. Note: Do not delete this project, you will need it

Testsuite: Symfony Code Completion



Notice: Depends on BUG 174917. Don't proceed if not Resolved Fixed

Check variables passing from controller to template

    1. use project from previous testsuite
    2. open apps/frontend/modules/home/actions/actions.class.php
    3. delete it's content
    4. paste following lines into the file
class homeActions extends sfActions
{
   public function executeIndex(sfWebRequest $request)
  {
    $this->passedVariable = "I wanna this variable in template"; 
  }
}
    1. open apps/frontend/modules/home/templates/indexSuccess.php
    2. write into indexSuccess.php $pass and invoke code completion (ctr+space)
    • EXPECTED RESULT: $passedVariable should be offered
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