Ⅰ. 插件描述
vim plugin to run PHPUnit testsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'klokane/phpunit'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'klokane/phpunit'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'klokane/phpunit'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/klokane/vim-phpunit
Ⅳ. 文档说明
Vim Plugin PHPUnit
this plugin allows you run tests directly from vim
INSTALL
just copy 'phpunit.vim' to your '$HOME/.vim/plugins' directry
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 <g:phpunit_tests> variable
:PhpUnitSwitchFile
Open testfile for current file. Name of testfile is taken from curent path in following way:
<g:phpunit_testroot>/<current path>/<file name>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
- [file] dir/file.php => [test] <g:phpunit_testroot>/dir/fileTest
[file] <g:phpunit_testroot>/dir/fileTest => [test] <g:phpunit_testroot>/dir/fileTest