Difference between #9 and #8 of NetBeans IDE and Yii projects

unchanged
Title
NetBeans IDE and Yii projects
unchanged
Category
Tutorials
changed
Tags
IDE
changed
Content
This page is created to supply short directions and general tips for managing a
Yii application in NetBeans IDE.

## Testing

To run functional tests and unit tests in Yii, recommended is installing PHPUnit
and SeleniumRC.

- Install PHPUnit
  - Follow [the official installation
instructions](http://www.phpunit.de/manual/3.0/en/installation.html).
  - Open "Tools > Options > PHP > Unit Testing" and set the
correct path to phpunit.bat
- Install SeleniumRC by getting the NetBeans plugin
  - Open "Tools > Plugins > Available Plugins"
  - Install "Selenium Module for PHP"
- Configure project options
  - Open "File > Project properties > Sources" and set
"Test Folder" to \[PROJECT ROOT\]/protected/tests
  - Open "File > Project properties > PHPUnit" and set "Use
Bootstrap" to \[PROJECT ROOT\]/protected/tests/bootstrap.php, and "Use
XML Configuration" to \[PROJECT ROOT\]/protected/tests/phpunit.xml

#### Usage:
- Test whole project: Alt+F6
- Test single file: Shift-F6
- Check code coverage (right click project > Code Coverage)


## Code completion

To get context sensitive code completion, follow these steps:

- Include Yii folder (outside project directory)
  - Open "File > Project properties > PHP Include Path" and add
the Yii framework root path
- Ignore yiilite.php to avoid doubled/missing documentation
  - Open "Tools > Options > Miscellaneous > Files"
  - Add to the front of "Files Ignored by the IDE" the file
"^(_yiilite\\.php_|CVS|SCCS|...."
  - Restart NetBeans

#### Usage:
- Typing suggestions: Ctrl-Space
- Show Function parameters: Ctrl-P
- Comment your own code with PHPDoc style. [Here's a good
example](http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_sample2.pkg.html).


## Debugging

- Install the Xdebug extension for PHP
  - Apache and PHP 5.3, php.ini: <pre>zend_extension =
"C:\xampp\php\ext\php_xdebug.dll"
       xdebug.remote_enable = 1
       xdebug.remote_handler = "dbgp"
       xdebug.remote_host = "localhost"
       xdebug.remote_port = 9000</pre>

#### Usage:
- Debug project: Ctrl-F5
- Use breakpoints, walk through running code, and watch variables and objects in
real-time. :)

# Test Driven Design with Netbeans
Check the forum here:
http://www.yiiframework.com/forum/index.php?/topic/11735-netbeans-ide-and-test-driven-development/<http://www.yiiframework.com/forum/index.php?/topic/11735-netbeans-ide-and-test-driven-development/>