Is there an easy way to run phpunit on open php test file inside vim?
|
I don’t know PHPUnit’s call syntax by heart, but probably something like |
|||
|
|
|
I personally like to set up a key mapping for running different tools. My mapping for PHPUnit looks like this (added to ~/.vim/ftplugin/php.vim, accessible at https://github.com/archwisp/linux-home/blob/master/.vim/ftplugin/php.vim):
Thus, when editing a unit test file, I just press, ",u" and the runtests script specific to the project is executed with the current file name as an argument. I create a runtests script for each project because each project is set up differently and this allows me to use the same key mapping for each project. The other added benefit is that this script can be run from the command-line or by a continuous integration package. An example runtests script can be seen here: https://github.com/archwisp/MindFrame2/blob/master/bin/runtests |
|||
|
|
|
I don’t know PHPUnit either, however, I'd have set
and then navigate among the failed assertions with |
|||
|
|