Go to test for PHP

2 Points

Nelson Senna do Amaral Nelson Senna do Amaral

10 years ago

This will try to find the test file for the current file (%) and open it in a new tab.

function GoToTest(...)
    let filename = expand('%:t:r')
    let test_filename = filename."Test.php"
    if a:0 > 0
        execute "tabf **/".a:1."/".test_filename
    else
        execute "tabf **/".test_filename
    endif
endfunction