2018-09-27 15:48:47 +00:00
|
|
|
Before:
|
|
|
|
call ale#assert#SetUpLinterTest('php', 'psalm')
|
|
|
|
|
|
|
|
After:
|
2020-08-29 15:31:47 +00:00
|
|
|
unlet! g:i
|
|
|
|
unlet! g:matched
|
|
|
|
|
2018-10-19 20:31:12 +00:00
|
|
|
if isdirectory(g:dir . '/.git')
|
|
|
|
call delete(g:dir . '/.git', 'd')
|
|
|
|
endif
|
|
|
|
|
2018-09-27 15:48:47 +00:00
|
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
|
2018-10-19 20:31:12 +00:00
|
|
|
Execute(The default executable path should be correct):
|
2019-07-25 21:00:49 +00:00
|
|
|
AssertLinter 'psalm',
|
|
|
|
\ ale#Escape('psalm') . ' --language-server'
|
2018-10-19 20:31:12 +00:00
|
|
|
|
|
|
|
Execute(Vendor executables should be detected):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/psalm/test.php')
|
2018-10-19 20:31:12 +00:00
|
|
|
|
|
|
|
AssertLinter
|
2021-03-20 22:11:22 +00:00
|
|
|
\ ale#path#Simplify(g:dir . '/../test-files/psalm/vendor/bin/psalm'),
|
2018-10-19 20:31:12 +00:00
|
|
|
\ ale#Escape(ale#path#Simplify(
|
|
|
|
\ g:dir
|
2021-03-20 22:11:22 +00:00
|
|
|
\ . '/../test-files/psalm/vendor/bin/psalm'
|
2019-07-25 21:00:49 +00:00
|
|
|
\ )) . ' --language-server'
|
2018-09-27 15:48:47 +00:00
|
|
|
|
2020-08-29 15:31:47 +00:00
|
|
|
let g:ale_php_psalm_use_global = 1
|
|
|
|
|
|
|
|
AssertLinter 'psalm',
|
|
|
|
\ ale#Escape('psalm') . ' --language-server'
|
|
|
|
|
2019-07-25 21:01:53 +00:00
|
|
|
Execute(User provided options should be used):
|
2020-08-29 15:31:47 +00:00
|
|
|
let g:ale_php_psalm_options = '--my-user-provided-option my-value'
|
2019-07-25 21:01:53 +00:00
|
|
|
|
|
|
|
AssertLinter 'psalm',
|
|
|
|
\ ale#Escape('psalm')
|
|
|
|
\ . ' --language-server --my-user-provided-option my-value'
|
2021-11-15 12:17:18 +00:00
|
|
|
|
|
|
|
Execute(The project path should be correct for composer.json file):
|
|
|
|
call ale#test#SetFilename('../test-files/php/with-composer/test.php')
|
|
|
|
|
|
|
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/php/with-composer')
|