Skip to content

Instantly share code, notes, and snippets.

@wsdjeg
Last active June 2, 2016 13:45
Show Gist options
  • Save wsdjeg/dffa5280d15e2c1e347051ef3e372a02 to your computer and use it in GitHub Desktop.
Save wsdjeg/dffa5280d15e2c1e347051ef3e372a02 to your computer and use it in GitHub Desktop.
TestFunc
function! TestFunction()
let lnum = line(".")
let col = col(".")
let func = getline(search("\\h\\+\\s\\+\\h\\+\\s*(.*)", 'bW'))
let func = substitute(func, '\v(public|protected|private|function)', '', 'g')
let func = substitute(func, '()', '', 'g')
let func = substitute(func, ' ', '', 'g')
let cmd = "phpunit " . expand('%:p') ." --filter " . func
let output = systemlist(cmd)
echomsg cmd . join(output)
call search("\\%" . lnum . "l" . "\\%" . col . "c")
endfun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment