Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Config script for using the watchr gem with PHPUnit on Yii
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

Using the watchr gem with PHPUnit on the Yii framework

What does it do?

Watchr is a Rubygem to monitor file changes. It can run your unit tests (or pretty much anything else you want) on the changed files.

This script is set up to perform the entire test suite in the 'unit/' folder of the Yii PHP framework every time a .php file in the Yii folder has changed. It uses growl notifications (growlnotify) to display a green OK or a red X to signal if the tests succeeded or failed.

Growl might be Mac OS X only. There might be similar notification service apps on other platforms.



  1. Install all the requirements
  2. Copy the watchr.rb script in the root of your Yii application (the one with the subfolders and framework).
  3. Copy the .watchr_images folder into your home folder.
  4. Run 'watchr watchr.rb' in the root of your Yii application.


For big test suites, it would be nice to only perform tests on the files that have actually changed. In my project, this is currently not an issue, as the entire test suite runs in a few seconds. If anyone wants to implement that, I'd be interested.

Something went wrong with that request. Please try again.