summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
authorShahin Sorkh <sorkh.shahin@hotmail.com>2019-03-26 01:59:34 +0430
committerw0rp <w0rp@users.noreply.github.com>2019-03-25 21:29:34 +0000
commitad998211f892cdbfac6df3ab296a4d1b849f4086 (patch)
treece884aa0b9dfb57b1bb0c06252b116c9164e7e39 /test/command_callback
parent80ef7ea2d0b22f0d8de7387a3d5bf6e9e5b72e9d (diff)
downloadale-ad998211f892cdbfac6df3ab296a4d1b849f4086.zip
Use location of `composer.json` for PHP project path too (#2391)
* move php-langserver "test for .git dir" test-project to its own directory * search for composer.json file in php-langserver first then .git dir * add test for php-langserver composer.json
Diffstat (limited to 'test/command_callback')
-rw-r--r--test/command_callback/php-langserver-project/with-composer/composer.json0
-rwxr-xr-xtest/command_callback/php-langserver-project/with-composer/vendor/bin/php-language-server.php0
-rwxr-xr-xtest/command_callback/php-langserver-project/with-git/vendor/bin/php-language-server.php0
-rw-r--r--test/command_callback/test_php_langserver_callbacks.vader15
4 files changed, 8 insertions, 7 deletions
diff --git a/test/command_callback/php-langserver-project/with-composer/composer.json b/test/command_callback/php-langserver-project/with-composer/composer.json
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/php-langserver-project/with-composer/composer.json
diff --git a/test/command_callback/php-langserver-project/with-composer/vendor/bin/php-language-server.php b/test/command_callback/php-langserver-project/with-composer/vendor/bin/php-language-server.php
new file mode 100755
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/php-langserver-project/with-composer/vendor/bin/php-language-server.php
diff --git a/test/command_callback/php-langserver-project/with-git/vendor/bin/php-language-server.php b/test/command_callback/php-langserver-project/with-git/vendor/bin/php-language-server.php
new file mode 100755
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/php-langserver-project/with-git/vendor/bin/php-language-server.php
diff --git a/test/command_callback/test_php_langserver_callbacks.vader b/test/command_callback/test_php_langserver_callbacks.vader
index 3b0a427e..59c3fe6c 100644
--- a/test/command_callback/test_php_langserver_callbacks.vader
+++ b/test/command_callback/test_php_langserver_callbacks.vader
@@ -2,10 +2,6 @@ Before:
call ale#assert#SetUpLinterTest('php', 'langserver')
After:
- if isdirectory(g:dir . '/.git')
- call delete(g:dir . '/.git', 'd')
- endif
-
call ale#assert#TearDownLinterTest()
Execute(The default executable path should be correct):
@@ -23,7 +19,12 @@ Execute(Vendor executables should be detected):
\ ))
Execute(The project path should be correct for .git directories):
- call ale#test#SetFilename('php-langserver-project/test.php')
- call mkdir(g:dir . '/.git')
+ call ale#test#SetFilename('php-langserver-project/with-git/test.php')
+ silent! call mkdir('php-langserver-project/with-git/.git')
+
+ AssertLSPProject ale#path#Simplify(g:dir . '/php-langserver-project/with-git')
+
+Execute(The project path should be correct for composer.json file):
+ call ale#test#SetFilename('php-langserver-project/with-composer/test.php')
- AssertLSPProject g:dir
+ AssertLSPProject ale#path#Simplify(g:dir . '/php-langserver-project/with-composer')