Ⅰ. 插件描述
Vim phpunit pluginⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'wdalmut/vim-phpunit-treacherous'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'wdalmut/vim-phpunit-treacherous'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'wdalmut/vim-phpunit-treacherous'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/wdalmut/vim-phpunit
Ⅳ. 文档说明
# PHPUnit runner for Vim
PHPUnit is a plugin for Vim that allows you to run PHPUnit tests easily from the Vim window. <s>It then reads the output and puts the errors into the quickfix list, so you can easily jump to them. It's configurable too, so if you use a PHPUnit wrapper command or have a special set of arguments, then that's no problem.</s>
This project is a personal fork of joonty/vim-phpunitqf (i have removed the
quickfix)
How to use
In a Vim window, run:
:Test <args>Where <args> are passed directly to the PHPUnit command. To set up a custom PHPUnit command see the configuration section below. You can also set default arguments which will always be passed.
Installation
Installation is easy-peasy if you're using Vundle. Just add this to your .vimrc file:
Bundle 'wdalmut/vim-phpunit.git'and run vim +BundleInstall +qall from a terminal.
If you aren't using vundle, you will have to extract the files in each folder to the correct folder in .vim/.
Configuration
By default the plugin tries different phpunit paths in order to discover your
phpunit executable, but you can override it with:
let g:phpunit_cmd = "/usr/bin/mytest"To pass arguments to the command, use:
let g:phpunit_args = "--configuration /path/to/config"You can also specify arguments to be placed after the "dynamic" argument (the argument passed when running from within Vim):
let g:phpunit_args_append = "--repeat"The output is written to a temporary file. You can change the location of this (default value is /tmp/vim_phpunit.out) with:
let g:phpunit_tmpfile = "/my/new/tmp/file"License
This plugin is released under the MIT License.