Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function! OpenUnitTest()
- let file = expand("%:p")
- let words = split(getline(search('^class ')))
- let words = split(words[1],"_")
- let paths = matchlist(file, '\([A-Za-z0-9/].*\)/application')
- let head = paths[1]
- let path = "/tests"
- let counter = 0
- for word in words
- if counter < 2
- let word = tolower(word)
- endif
- let path = path . "/" . word
- let counter = counter + 1
- endfor
- let path = head . path . "Test.php"
- exe 'new' path
- return path
- endfunction
Add Comment
Please, Sign In to add comment