mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-20 18:14:33 +08:00
#3633 - Put all dummy test files in test/test-files
This commit is contained in:
@@ -19,48 +19,48 @@ After:
|
||||
call ale#test#RestoreDirectory()
|
||||
|
||||
Execute(project with phpcbf should use local by default):
|
||||
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
|
||||
call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf'),
|
||||
\ ale#fixers#phpcbf#GetExecutable(bufnr(''))
|
||||
|
||||
Execute(use-global should override local detection):
|
||||
let g:ale_php_phpcbf_use_global = 1
|
||||
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
|
||||
call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ 'phpcbf_test',
|
||||
\ ale#fixers#phpcbf#GetExecutable(bufnr(''))
|
||||
|
||||
Execute(project without phpcbf should use global):
|
||||
call ale#test#SetFilename('php_paths/project-without-phpcbf/foo/test.php')
|
||||
call ale#test#SetFilename('../test-files/php/project-without-phpcbf/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ 'phpcbf_test',
|
||||
\ ale#fixers#phpcbf#GetExecutable(bufnr(''))
|
||||
|
||||
Execute(The phpcbf callback should return the correct default values):
|
||||
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
|
||||
call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' },
|
||||
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' },
|
||||
\ ale#fixers#phpcbf#Fix(bufnr(''))
|
||||
|
||||
Execute(The phpcbf callback should include the phpcbf_standard option):
|
||||
let g:ale_php_phpcbf_standard = 'phpcbf_ruleset.xml'
|
||||
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
|
||||
call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . '--standard=phpcbf_ruleset.xml' . ' -'},
|
||||
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . '--standard=phpcbf_ruleset.xml' . ' -'},
|
||||
\ ale#fixers#phpcbf#Fix(bufnr(''))
|
||||
|
||||
Execute(User provided options should be used):
|
||||
let g:ale_php_phpcbf_options = '--my-user-provided-option my-value'
|
||||
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
|
||||
call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . ale#Pad('--my-user-provided-option my-value') . ' -'},
|
||||
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . ale#Pad('--my-user-provided-option my-value') . ' -'},
|
||||
\ ale#fixers#phpcbf#Fix(bufnr(''))
|
||||
|
||||
|
||||
@@ -85,39 +85,39 @@ After:
|
||||
call ale#test#RestoreDirectory()
|
||||
|
||||
Execute(project with phpcbf should use local by default):
|
||||
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
|
||||
call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf'),
|
||||
\ ale#fixers#phpcbf#GetExecutable(bufnr(''))
|
||||
|
||||
Execute(use-global should override local detection):
|
||||
let g:ale_php_phpcbf_use_global = 1
|
||||
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
|
||||
call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ 'phpcbf_test',
|
||||
\ ale#fixers#phpcbf#GetExecutable(bufnr(''))
|
||||
|
||||
Execute(project without phpcbf should use global):
|
||||
call ale#test#SetFilename('php_paths/project-without-phpcbf/foo/test.php')
|
||||
call ale#test#SetFilename('../test-files/php/project-without-phpcbf/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ 'phpcbf_test',
|
||||
\ ale#fixers#phpcbf#GetExecutable(bufnr(''))
|
||||
|
||||
Execute(The phpcbf callback should return the correct default values):
|
||||
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
|
||||
call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' },
|
||||
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' },
|
||||
\ ale#fixers#phpcbf#Fix(bufnr(''))
|
||||
|
||||
Execute(The phpcbf callback should include the phpcbf_standard option):
|
||||
let g:ale_php_phpcbf_standard = 'phpcbf_ruleset.xml'
|
||||
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
|
||||
call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . '--standard=phpcbf_ruleset.xml' . ' -'},
|
||||
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . '--standard=phpcbf_ruleset.xml' . ' -'},
|
||||
\ ale#fixers#phpcbf#Fix(bufnr(''))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user