Created
March 21, 2013 15:32
-
-
Save tonini/5213948 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun phpunit-command () | |
| "Returns the phpunit command path (vendor/bin or bin/ because of composer)" | |
| (cond ((file-readable-p (concat (cabbage-project-root) "vendor/bin/phpunit")) | |
| (concat (cabbage-project-root) "vendor/bin/phpunit")) | |
| ((file-readable-p (concat (cabbage-project-root) "bin/phpunit")) | |
| (concat (cabbage-project-root) "bin/phpunit")) | |
| (t "phpunit"))) | |
| (defun phpunit-config-file () | |
| "Returns a given phpunit config file if exists (check app/ because of symfony default.)" | |
| (cond ((file-readable-p (concat (cabbage-project-root) "app/phpunit.xml")) | |
| (format "%s %s" "-c" (concat (cabbage-project-root) "app/phpunit.xml"))) | |
| ((file-readable-p (concat (cabbage-project-root) "phpunit.xml")) | |
| (format "%s %s" "-c" (concat (cabbage-project-root) "phpunit.xml"))) | |
| (t ""))) | |
| (defun phpunit-default-options () | |
| (format "%s %s" (phpunit-config-file) "--colors")) | |
| (defun phpunit-runner () | |
| "Returns command line to run phpunit" | |
| (format "%s %s" (phpunit-command) (phpunit-default-options))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment