Guest User

Untitled

a guest
Jan 23rd, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. function! OpenUnitTest()
  2. let file = expand("%:p")
  3. let words = split(getline(search('^class ')))
  4. let words = split(words[1],"_")
  5. let paths = matchlist(file, '\([A-Za-z0-9/].*\)/application')
  6. let head = paths[1]
  7. let path = "/tests"
  8. let counter = 0
  9. for word in words
  10. if counter < 2
  11. let word = tolower(word)
  12. endif
  13. let path = path . "/" . word
  14. let counter = counter + 1
  15. endfor
  16. let path = head . path . "Test.php"
  17. exe 'new' path
  18. return path
  19. endfunction
Add Comment
Please, Sign In to add comment