2017-06-21 20:35:40 +00:00
|
|
|
Before:
|
2017-06-21 21:33:34 +00:00
|
|
|
Save g:ale_php_phpcs_executable
|
|
|
|
Save g:ale_php_phpcs_use_global
|
|
|
|
|
2017-06-21 20:35:40 +00:00
|
|
|
let g:ale_php_phpcs_executable = 'phpcs_test'
|
2017-06-21 21:33:34 +00:00
|
|
|
let g:ale_php_phpcs_use_global = 0
|
2017-06-21 20:35:40 +00:00
|
|
|
|
2017-07-09 21:43:25 +00:00
|
|
|
call ale#test#SetDirectory('/testplugin/test')
|
2017-06-21 20:35:40 +00:00
|
|
|
|
|
|
|
runtime ale_linters/php/phpcs.vim
|
|
|
|
|
|
|
|
After:
|
2017-06-21 21:33:34 +00:00
|
|
|
Restore
|
2017-06-21 20:35:40 +00:00
|
|
|
|
2017-07-09 21:43:25 +00:00
|
|
|
call ale#test#RestoreDirectory()
|
2017-06-21 20:35:40 +00:00
|
|
|
call ale#linter#Reset()
|
|
|
|
|
|
|
|
Execute(project with phpcs should use local by default):
|
2017-06-21 21:33:34 +00:00
|
|
|
call ale#test#SetFilename('phpcs-test-files/project-with-phpcs/foo/test.php')
|
2017-06-21 20:35:40 +00:00
|
|
|
|
|
|
|
AssertEqual
|
2017-09-10 23:47:27 +00:00
|
|
|
\ ale#path#Winify(g:dir . '/phpcs-test-files/project-with-phpcs/vendor/bin/phpcs'),
|
2017-06-21 20:35:40 +00:00
|
|
|
\ ale_linters#php#phpcs#GetExecutable(bufnr(''))
|
|
|
|
|
|
|
|
Execute(use-global should override local detection):
|
|
|
|
let g:ale_php_phpcs_use_global = 1
|
|
|
|
|
2017-06-21 21:33:34 +00:00
|
|
|
call ale#test#SetFilename('phpcs-test-files/project-with-phpcs/foo/test.php')
|
2017-06-21 20:35:40 +00:00
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ 'phpcs_test',
|
|
|
|
\ ale_linters#php#phpcs#GetExecutable(bufnr(''))
|
|
|
|
|
|
|
|
Execute(project without phpcs should use global):
|
2017-06-21 21:33:34 +00:00
|
|
|
call ale#test#SetFilename('phpcs-test-files/project-without-phpcs/foo/test.php')
|
2017-06-21 20:35:40 +00:00
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ 'phpcs_test',
|
|
|
|
\ ale_linters#php#phpcs#GetExecutable(bufnr(''))
|