Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
vim plugin to run PHPUnit tests
VimL
Branch: master

This branch is 11 commits ahead of klokane:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
ftplugin/php
Makefile
README.mkd

README.mkd

Vim Plugin PHPUnit

this plugin allows you run tests directly from vim

INSTALL

just copy 'phpunit.vim' to your '$HOME/.vim/ftplugin/php/' directry

or install through Makefile

$ make install

USAGE

There are defined three commands

:PhpUnit [path]

run phpunit with path. Path is not manadatory. If Path is not defined it vim-phpunit use variable

:PhpUnitSwitchFile

Open testfile for current file. Name of testfile is taken from curent path in following way: //Test.php and vice versa for testing file (if you are on test file, it will open source file complementary to testfile)

version 0.1 doesn't care about path existence - it's your responsibility (maybe in next version)

:PhpUnitFile

run phpunit for current file. There is heuristic like :PhpUnitSwitchFile eg.

[file] dir/file.php => [test] <g:phpunit_testroot>/dir/fileTest
[file] <g:phpunit_testroot>/dir/fileTest => [test] <g:phpunit_testroot>/dir/fileTest

CONFIGURATION

configure your phpunit plugin in your .vimrc file:

let g:phpunit_testroot = 'tests'
let g:phpunit_tests = g:phpunit_testroot
let g:phpunit_params = '--stop-on-failure'
let g:phpunit_highlights = 1
Something went wrong with that request. Please try again.