Created
April 16, 2019 21:55
-
-
Save nick-f/e255b4d96238d7a3bd56994e137f3e10 to your computer and use it in GitHub Desktop.
Vim mappings for running PHPUnit tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Run the whole test suite | |
nnoremap <leader>TS :!./vendor/bin/phpunit<cr> | |
" Run all tests in the current file | |
nnoremap <leader>T :!./vendor/bin/phpunit %<cr> | |
" Place your cursor within the test function to run a single test | |
" Need to install https://github.com/tyru/current-func-info.vim | |
function! RunPhpUnitTest() | |
let testFunction=cfi#format("%s", "") | |
execute '! ./vendor/bin/phpunit --filter='testFunction | |
endfunction | |
nnoremap <leader>t :call RunPhpUnitTest()<cr> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment