ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

PHPUnit

by stuartherbert ST2/ST3

PHPUnit Support for Sublime Text 2

Details

  • 2015.07.17.15.28.37
  • github.​com
  • github.​com
  • 2 years ago
  • 13 minutes ago
  • 5 years ago

Installs

  • Total 52K
  • Win 28K
  • OS X 12K
  • Linux 12K
Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8
Windows 15 13 21 12 10 9 14 12 16 13 16 14 9 24 13 20 18 19 8 13 18 17 16 17 18 14 16 10 23 15 17 18 12 11 15 17 20 18 16 15 14 12 16 18 12 17
OS X 4 2 5 3 4 3 3 7 7 9 4 0 4 4 7 7 7 1 4 2 2 5 1 6 6 1 3 5 10 3 4 3 2 3 4 3 4 2 7 3 3 4 4 4 1 7
Linux 6 7 7 7 5 4 9 7 7 2 5 5 9 7 8 6 5 4 7 3 6 4 7 8 5 4 5 5 10 9 1 6 2 4 10 5 10 9 8 2 1 6 7 5 7 8

Readme

Source
raw.​githubusercontent.​com

Sublime PHPUnit

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

Installation

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

Snippets

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'.