Skip to content

gerardroche/sublime-phpunit-snippets

Repository files navigation

phpunit-snippets

Author Source Code License GitHub stars Sublime version Latest version

PHPUnit snippets for Sublime Text.

THIS PROJECT IS NO LONGER MAINTAINED!

I moved all my snippets to my custom sublimefiles.

Overview

Works best with PHP Grammar, PHP Completions, PHP Snippets, PHPUnit, and PHPUnit Completions.

Features

  • PHPUnit ~4.4
  • DbUnit ~1.3
  • PSR compliant
  • Scoped to minimise auto-complete noise

Snippets

Trigger Description
phpunitxml PHPUnit: xml configuration declaration
provide PHPUnit: data provider test
setup PHPUnit: setup method declaration
teardown PHPUnit: teardown method declaration
test PHPUnit: test
testbootstrap PHPUnit: bootstrap
testcase PHPUnit: test case declaration
testd PHPUnit: test with annotated @depends

Key Bindings

OS X Windows Linux Description
Ctrl+Space Ctrl+Space Alt+/ Activate completions

To enable tab-completions set "tab_completion": true in Preferences > Settings - User.

Installation

Manual installation

  1. Close Sublime Text.
  2. Download or clone this repository to a directory named phpunit-snippets in the Sublime Text Packages directory for your platform:
    • Sublime Text 3
      • Linux: git clone https://github.com/gerardroche/sublime-phpunit-snippets.git ~/.config/sublime-text-3/Packages/phpunit-snippets
      • OS X: git clone https://github.com/gerardroche/sublime-phpunit-snippets.git ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/phpunit-snippets
      • Windows: git clone https://github.com/gerardroche/sublime-phpunit-snippets.git %APPDATA%\Sublime/ Text/ 3/Packages/phpunit-snippets
    • Sublime Text 2
      • Linux: git clone https://github.com/gerardroche/sublime-phpunit-snippets.git ~/.config/sublime-text-2/Packages/phpunit-snippets
      • OS X: git clone https://github.com/gerardroche/sublime-phpunit-snippets.git ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/phpunit-snippets
      • Windows: git clone https://github.com/gerardroche/sublime-phpunit-snippets.git %APPDATA%\Sublime/ Text/ 2/Packages/phpunit-snippets
  3. Restart Sublime Text to complete installation. The features listed above should now be available.

Contributing

Your issue reports and pull requests are always welcome.

Changelog

See CHANGELOG.md.

License

Released under the BSD 3-Clause License.