Difference between #4 and #5 of Configuring PhpStorm IDE for Yii

unchanged
Title
Configuring PhpStorm IDE for Yii
unchanged
Category
Tips
unchanged
Tags
IDE, PhpStorm
changed
Content
Code completion
---------------
  1. Exclude `yiilite.php` from index:
    - `File → Settings → IDE Settings → File Types`.
    - `yiilite.php` to `Ignore files and folders`.
  2. Exclude not used directories, specify resources.
    - `File → Settings → Project settings → Directories`.
    - Mark `framework/cli/views`, `protected/runtime` and `assets` as
`excluded`.
    - Mark website root as `resource root`.
  3. Specify path to your PHP.
    - `File → Settings → Project settings → PHP → PHP Home`.
  4. If your project uses common Yii framework folder you need to include it.
  - `File → Settings → Project settings → PHP → PHP Home → Add`.
  - Specify a path to `framework` directory.
  5. If you are writing unit tests you can include PHPUnit to get code
completion:
  - `File → Settings → Project settings → PHP → PHP Home → Add`.
  - Specify a path to PHPUnit.

  - Complete code: `Ctrl+Space`.
  - Show method arguments: `Ctrl+Q`.

Enhanced code navigation
------------------------

In order to be able to get from `render` or `renderPartial` to the view, from
`widget` to widget class, from `relations` to model classes you need to [install
additional plugin called YiiStorm](http://mazx.ru/).

Testing
-------

You should install PHPUnit to run unit tests.

1. PHPUnit.
    - Follow [official PHPUnit installation
guide](http://www.phpunit.de/manual/3.0/en/installation.html).
    - In your IDE: `Run → Edit configurations`.
    - Press "+".
    - `Name`: anything.
    - `Test`: depending on what do you want to test select an appropriate
option. Specify path.
    - `Use XML configuration file`: specifying path to `phpunit.xml`. Often it's
`path_to_your_webroot/protected/tests/phpunit.xml`.

  - To run tests use `SHIFT+F10`.