-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support custom phpunit command #39
Support custom phpunit command #39
Conversation
HI @zonuexe. Is there any chance that this could be merged in? This would help me (and I'm sure many more people) so much. I'm a bit of a noob at emacs-lisp so at the moment I'm running my tests through the command line manually. Thanks :) |
@CarwynNelson @nlamirault |
Done. I create a new release (0.14.0) |
@nlamirault thanks! |
Hi @zonuexe Sorry to be a bit of a bother. I'm quite new to emacs and emacs-lisp and was wondering if you could provide a little help? The instructions in your pull request mention using Is it possible to have a dotfile, or something similar, in the root of a project with these Thanks very much! |
Probably, you can do it by Other way, you can set variables by (defun your-php-mode-hook ()
"Your PHP-mode hook."
(when (and buffer-file-name (string-match "/your-awesome-project/" buffer-file-name))
(setq-local phpunit-program "docker")
(setq-local phpunit-arg '("exec" "-it" "container" "phpunit"))))
(add-hook 'php-mode-hook 'your-php-mode-hook) |
EDIT: I have upgraded to the latest version of emacs that I can get which is Hi @zonuexe Thanks for the reply, I really appreciate it! I have tried your method of using a php-mode hook but that doesn't seem to work for me for some reason. Here is the code I have added to my php.el (included in init.el) (defun hyperion-in-docker ()
"Run Hyperion tests in docker container"
(when (and buffer-file-name (string-match "/hyperion/hyperion/") buffer-file-name))
(setq-local phpunit-program "docker")
(setq-local phpunit-arg '("exec" "-it" "hyperion_php_1" "phpunit")))
(add-hook 'php-mode-hook 'hyperion-in-docker) But for some reason the phpunit command still runs the local install of phpunit: -*- mode: compilation; default-directory: "~/development/hyperion/hyperion/" -*-
Compilation started at Tue Dec 20 09:37:13
stty cols 139; ./vendor/bin/phpunit
Bunch of errors here because phpunit is not being run inside of the container. Here is the output from
I have had a look and confirmed that the version of the phpunit script for emacs is indeed 0.14.0 ;; URL: https://github.com/nlamirault/phpunit.el
;; Version: 0.14.0
;; Keywords: php, tests, phpunit Do you have any suggestions as to what I might be doing incorrectly? |
@zonuexe I managed to get it working! Thanks very much for all the help! I'll see if I can find the time to add this to the documentation for future emacs newcomers :) |
@zonuexe do you want commit access right for this project ? |
@CarwynNelson I could not help you, but I am pleased that you succeeded in self-help! |
@nlamirault |
ref #38
Usage