PHPUnit Support for Sublime Text 2
Python JavaScript
Failed to load latest commit information.
color-schemes New: much improved output panel, thanks to… Jul 12, 2015
Default.sublime-commands Workarounds to get PHPUnit commands appearing in the CTRL-SHIFT-P menu May 11, 2013 Added Feb 2, 2012
PHPUnit TextRunner.tmLanguage Fix: be stricter on matching the info we add to the output Jul 16, 2015
PHPUnit.sublime-settings Fix: do not look inside any node_modules folder Jul 6, 2015 Update Feb 25, 2015
Side Bar.sublime-menu Important performance optimisations Feb 7, 2012
phpunit-test-with-data.sublime-snippet phpunit-test-with-data snippet: mark tests as incomplete by default (… Nov 28, 2012
phpunit-test.sublime-snippet phpunit-test snippet: mark tests as incomplete by default (for issue #13 Nov 28, 2012
phpunit-testcase.sublime-snippet Fix: for case-sensitive filesystems Jul 17, 2015

Sublime PHPUnit

This plugin adds PHPUnit support to Sublime Text 2 & 3.


Use Package Control (Preferences -> Package Control -> Install Package -> PHPUnit) to install this plugin.

PHPUnit Support For Sublime Text

This plugin adds support for running PHPUnit tests from inside Sublime Text.

Right-click in the editor to:

  • Run all unit tests
  • Run the unit tests for the current file
  • Run the unit tests in the current file
  • Run PHPUnit, using the current XML config file
  • Goto the file containing the tests or the file being tested

Right-click in the side-bar to:

  • Run the unit tests in the current file
  • Run all the unit tests
  • Run PHPUnit, using the selected XML config file

You can also open up the Command Palette (CTRL + SHIFT + P on Linux), and type 'PHPUnit' to see what you can do with PHPUnit in the currently open file.

To make this work, you need to create a phpunit.xml.dist or phpunit.xml file for your code (projects using Phix get this for free). The Sublime-PHPUnit plugin searches the folders upwards from whatever you are trying to test, using the first phpunit.xml or phpunit.xml.dist that it finds. Make sure that your phpunit.xml file is either at the top of your tests folder (or even further up), and this plugin will work for you.

PHPUnit support is based on the Ruby Tests plugin


We add the following snippets to speed up writing PHP test code.

To use any of the snippets, simply type the name of the snippet, then press the key. Sublime Text 2 will insert the snippet, and you can then use the key to move through any placeholders that you need to replace.

  • phpunit-test: create a new test method inside your TestCase class
  • phpunit-testcase: create a new TestCase class to put your tests inside

Contributions Welcome

Requests for features, and pull requests with patches, are most welcome :)

Please make sure that your pull requests are against the 'develop' branch and not 'master'.