summaryrefslogtreecommitdiff
path: root/test/fixers/test_php_cs_fixer.vader
diff options
context:
space:
mode:
authorAdriaan Zonnenberg <adriaanzon@users.noreply.github.com>2018-04-07 23:53:03 +0200
committerw0rp <w0rp@users.noreply.github.com>2018-04-07 23:53:03 +0200
commit121e806423830fa9e6bc1c7833f0624bd06903ff (patch)
treebcf6b33ec006f8f0342cc4845a54f99876565024 /test/fixers/test_php_cs_fixer.vader
parentbb775e4e22d1880bd015fbc3ea7fa203c9eeb6f9 (diff)
downloadale-121e806423830fa9e6bc1c7833f0624bd06903ff.zip
Add g:ale_php_cs_fixer_options variable (#1477)
* Add g:ale_php_cs_fixer_options variable * Fix test
Diffstat (limited to 'test/fixers/test_php_cs_fixer.vader')
-rw-r--r--test/fixers/test_php_cs_fixer.vader21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/fixers/test_php_cs_fixer.vader b/test/fixers/test_php_cs_fixer.vader
index b6579670..b47c190c 100644
--- a/test/fixers/test_php_cs_fixer.vader
+++ b/test/fixers/test_php_cs_fixer.vader
@@ -1,6 +1,8 @@
Before:
Save g:ale_php_cs_fixer_executable
+ Save g:ale_php_cs_fixer_options
let g:ale_php_cs_fixer_executable = 'php-cs-fixer'
+ let g:ale_php_cs_fixer_options = ''
call ale#test#SetDirectory('/testplugin/test/fixers')
silent cd ..
@@ -42,5 +44,22 @@ Execute(The php-cs-fixer callback should return the correct default values):
call ale#test#SetFilename('php_paths/project-without-php-cs-fixer/foo/test.php')
AssertEqual
- \ {'read_temporary_file': 1, 'command': ale#Escape('php-cs-fixer') . ' fix %t' },
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('php-cs-fixer')
+ \ . ' ' . g:ale_php_cs_fixer_options
+ \ . ' fix %t'
+ \ },
+ \ ale#fixers#php_cs_fixer#Fix(bufnr(''))
+
+Execute(The php-cs-fixer callback should include custom php-cs-fixer options):
+ let g:ale_php_cs_fixer_options = '--config="$HOME/.php_cs"'
+ call ale#test#SetFilename('php_paths/project-without-php-cs-fixer/test.php')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_php_cs_fixer_executable)
+ \ . ' --config="$HOME/.php_cs" fix %t',
+ \ 'read_temporary_file': 1,
+ \ },
\ ale#fixers#php_cs_fixer#Fix(bufnr(''))