;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\306\307\310\311\312\313\314\315\316\317\316\320& \210\321\322\310\323\324\325%\210\326\327\322\330#\210\326\331\332\330#\210\321\333\310\334\324\335%\210\321\336\310\337\324\335%\210\321\340\310\341\324\335%\210\321\342\310\343\324\335%\210\321\344\310\345\324\346%\210\321\347\310\350\324\351%\210\321\352\310\353\324\354%\210\321\355\310\356\324\335\316\307&\207" [require cl-lib compile tramp s f custom-declare-group phpunit nil "PHPUnit utility" :tag "PHPUnit" :prefix "phpunit-" :group tools php custom-declare-variable phpunit-default-program "PHPUnit command or path to executable file or a function that returns these string." :type (choice (file :tag "Path to PHPUnit executable file.") (function :tag "A function return PHPUnit executable file path.") (string :tag "PHPUnit command name. (require command in PATH)")) make-obsolete-variable phpunit-program "0.18.0" phpunit-arg phpunit-args phpunit-stop-on-error "Stop execution upon first error." boolean phpunit-stop-on-failure "Stop execution upon first error or failure." phpunit-stop-on-skipped "Stop execution upon first skipped test." phpunit-verbose-mode "Display debugging information during test execution." phpunit-configuration-file "The PHPUnit configuration file." (choice (file :tag "Path to phpunit.xml[.dist]") (const :tag "Automatically detect the path of phpunit.xml" nil)) phpunit-bootstrap-file "The PHPUnit bootstrap file." (choice (file :tag "Path to PHPUnit bootstrap script") (const :tag "Not specify boostrap script" nil)) phpunit-colorize "Colorize PHPUnit compilation output buffer." (choice (const :tag "Do not specific --color argument" nil) (const :tag "--color=auto" "auto") (const :tag "--color=never" "never") (const :tag "--color=always" "always")) phpunit-hide-compilation-buffer-if-all-tests-pass "Hide the compilation buffer if all tests pass."] 12) #@40 Regular expression for a PHP function. (defconst php-beginning-of-defun-regexp "^\\s-*\\(?:\\(?:abstract\\|final\\|p\\(?:r\\(?:ivate\\|otected\\)\\|ublic\\)\\|static\\)\\s-+\\)*\\s-*function\\s-+&?\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*(" (#$ . 2014)) #@37 Regular expression for a PHP class. (defconst php-beginning-of-class "^\\s-*\\(?:final\\s-\\)?\\s-*class\\s-+\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*" (#$ . 2264)) #@46 Valid syntax for a character in a PHP label. (defconst php-labelchar-regexp "[a-zA-Z_-\377][a-zA-Z0-9_-\377]" (#$ . 2425)) #@36 Directory path to execute PHPUnit. (defvar phpunit-root-directory nil (#$ . 2556)) (byte-code "\300\301!\210\302\301\303\304#\207" [make-variable-buffer-local phpunit-root-directory put safe-local-variable stringp] 4) #@38 Argument to pass to phpunit command. (defvar phpunit-args nil (#$ . 2780)) (byte-code "\300\301!\210\302\301\303\304#\207" [make-variable-buffer-local phpunit-args put safe-local-variable #[(v) ";\206<\207" [v] 1]] 4) #@45 PHPUnit command or path to executable file. (defvar phpunit-executable nil (#$ . 3008)) (byte-code "\301\302!\210\303\302\304\305#\210\203\306\307\310\"\210\301\207" [phpunit-hide-compilation-buffer-if-all-tests-pass make-variable-buffer-local phpunit-executable put safe-local-variable #[(v) "?\206 ;\206 \301!\207" [v functionp] 2] add-hook compilation-finish-functions phpunit--hide-compilation-buffer-if-all-tests-pass] 4) (defvar phpunit-last-group-cache nil) #@48 Get PHPUnit executable command in `DIRECTORY'. (defalias 'phpunit--find-executable #[(directory) "\206 \211;\203\n\202;\304\n!\203\n \202; \203.\305 \306P!\203.\307 \306P!\202;\310\311!\2038\311\202;\312\313!)\207" [phpunit-executable phpunit-default-program executable directory functionp file-exists-p "vendor/bin/phpunit" expand-file-name executable-find "phpunit" error "PHPUnit command/package is not installed"] 4 (#$ . 3487)]) #@95 Return the command to launch unit test. `ARGS' corresponds to phpunit command line arguments. (defalias 'phpunit-get-program #[(args) "\306\307\"\310 !\311!\203&\312\n!\211\242\f>\204!\313\314\315 D\"\210\316 8)\317\320\n! \205A\317\321 ;\2039 \202@\322\321\323\320 \"\"\"\203R\317\324\320\325!!\"\202S\326\203d\317\327\320\325!!\"\202e\326\205o\330\331\"\321&*\207" [default-directory vendor-dir executable cl-x cl-struct-tramp-file-name-tags phpunit-args locate-dominating-file "vendor" phpunit--find-executable file-remote-p tramp-dissect-file-name signal wrong-type-argument tramp-file-name 6 s-concat shell-quote-argument " " s-join mapcar " -c " expand-file-name "" " --bootstrap " format " --colors=%s" phpunit-configuration-file phpunit-bootstrap-file phpunit-colorize args] 10 (#$ . 3942)]) #@41 Return the root directory to run tests. (defalias 'phpunit-get-root-directory #[(&optional force-real-path) "\204 \206k\306 \307\211\204\f\202j \203\"\310\311 \"!\202j\312 \307\313\307 :\203\\ @\311 \"\211\203O\310\n!\307\211\202P\313\203\\ A\211 \2020\203g\310\314!\202i,*\207" [force-real-path phpunit-root-directory path filename default-directory phpunit-configuration-file buffer-file-name nil file-truename locate-dominating-file ("phpunit.xml" "phpunit.xml.dist" ".git" "composer.json") t "./" #1=#:--cl-var-- file #2=#:--cl-var-- #3=#:--cl-var--] 5 (#$ . 4779)]) #@88 Return the canonical unit test class name associated with the current class or buffer. (defalias 'phpunit-get-current-class #[nil "\212\301\302\303#\205\f\304\305!)\207" [php-beginning-of-class re-search-backward nil t match-string-no-properties 1] 4 (#$ . 5399)]) #@43 Get the name of the current test function (defalias 'phpunit-get-current-test #[nil "\212\301\302\303#\205\f\304\305!)\207" [php-beginning-of-defun-regexp re-search-backward nil t match-string-no-properties 1] 4 (#$ . 5672)]) #@119 Return list of @group. https://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.annotations.group (defalias 'phpunit--listing-groups #[nil "\305\306!\307\310\311\"r q\210\312\216c\210eb\210\313\314!\210\315\316!\210\317y\210\320\321\322`d\"\"\317\211\n:\203I\n@\323\324 \"\203B\325\324 \"\fB\nA\211\202-\f\237.\207" [phpunit-output #1=#:temp-buffer #2=#:--cl-var-- line #3=#:--cl-var-- phpunit--execute "--list-groups" generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] search-forward "Available test group" move-beginning-of-line 1 nil s-split "\n" buffer-substring-no-properties s-starts-with\? " - " s-chop-prefix] 6 (#$ . 5907)]) #@33 Get last group cache by `PATH'. (defalias 'phpunit--get-last-group #[(path) "\205 \302 \303#\207" [phpunit-last-group-cache path gethash nil] 4 (#$ . 6625)]) #@41 Put last group `GROUP' cache by `PATH'. (defalias 'phpunit--put-last-group #[(group path) "\204 \303\304\305\"\306 \n#\207" [phpunit-last-group-cache path group make-hash-table :test equal puthash] 4 (#$ . 6792)]) #@40 Append options to `ARGS' by variables. (defalias 'phpunit-arguments #[(args) "\203 \305 \306\"\n\203\305 \307\" \203\305 \310\"\f\203$\305 \311\" \207" [phpunit-stop-on-error args phpunit-stop-on-failure phpunit-stop-on-skipped phpunit-verbose-mode s-concat " --stop-on-error" " --stop-on-failure" " --stop-on-skipped" " --verbose"] 3 (#$ . 7016)]) #@55 Return command string to execute PHPUnit from `ARGS'. (defalias 'phpunit-get-compile-command #[(args) "\305>\203\f\306\307 !!\207\310\311\312 \"\313\306\307 !!\211 \nQ+\207" [system-type args phpunit-command command-separator column-setting-command (windows-nt ms-dos) phpunit-get-program phpunit-arguments format "stty cols %d" frame-width "; "] 6 (#$ . 7382)]) #@38 Colorize PHPUnit compilation buffer. (defalias 'phpunit--colorize-compilation-buffer #[nil "\302\303 `\")\207" [inhibit-read-only compilation-filter-start t ansi-color-apply-on-region] 3 (#$ . 7756)]) #@45 Setup hooks for PHPUnit compilation buffer. (defalias 'phpunit--setup-compilation-buffer #[nil "\300\301\302\"\210\300\303\304\"\207" [add-hook compilation-finish-functions phpunit--finish-compilation-buffer compilation-filter-hook phpunit--colorize-compilation-buffer] 3 (#$ . 7964)]) #@80 Setup hooks for PHPUnit compilation buffer. `CUR-BUFFER' and `MSG' are ignore. (defalias 'phpunit--finish-compilation-buffer #[(&optional cur-buffer msg) "\300\301\302\"\210\300\303\304\"\207" [remove-hook compilation-finish-functions phpunit--finish-compilation-buffer compilation-filter-hook phpunit--colorize-compilation-buffer] 3 (#$ . 8256)]) #@38 Execute phpunit command with `ARGS'. (defalias 'phpunit--execute #[(args) "\302 \303\304\305 !!!)\207" [default-directory args phpunit-get-root-directory shell-command-to-string phpunit-get-program phpunit-arguments] 4 (#$ . 8610)]) #@38 Execute phpunit command with `ARGS'. (defalias 'phpunit-run #[(args) "\303\304\305\"\210\306 \307\310\311\n!!*\207" [compilation-process-setup-function default-directory args add-to-list compilation-error-regexp-alist ("^\\(.+\\.php\\):\\([0-9]+\\)$" 1 2) phpunit-get-root-directory phpunit--setup-compilation-buffer compile phpunit-get-compile-command] 3 (#$ . 8850)]) #@107 Hide the compilation BUFFER if all tests pass. The STATUS describes how the compilation process finished. (defalias 'phpunit--hide-compilation-buffer-if-all-tests-pass #[(buffer status) "rq\210\305ed\"\306 !\307\310\n\"@\307\311\n\"@ \205&\312!\210\313\314 \f#-\207" [buffer buffer-string buffer-lines ok-msg time-msg buffer-substring-no-properties s-lines cl-remove-if-not #[(x) "\301\302\"\205\301\303\"\205\301\304\"\207" [x s-contains\? "OK" "test" "assertion"] 3] #[(x) "\301\302\"\205 \301\303\"\207" [x s-contains\? "Time" "Memory"] 3] delete-windows-on message "%s %s"] 4 (#$ . 9229)]) #@75 Create project file `.dir-locals.el' and set `VARIABLE' for `phpunit.el'. (defalias 'phpunit-set-dir-local-variable #[(variable) "\301\302\303\304\267\202\305\202\306\202\302!#\207" [variable add-dir-local-variable nil read-string #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (quote 10 phpunit-executable 10 phpunit-root-directory 14)) "Input a command to run PHPUnit: " "Input a directory path to execute PHPUnit: "] 6 (#$ . 9846) (list (intern (completing-read "Select variable name: " '(phpunit-executable phpunit-directory))))]) #@32 Launch PHPUnit on curent test. (defalias 'phpunit-current-test #[nil "\302\303\304 \305\306 \307\310\311\312 \"&\313 !)\207" [buffer-file-name args s-concat " --filter '" phpunit-get-current-class "::" phpunit-get-current-test "'" " " s-chop-prefix phpunit-get-root-directory phpunit-run] 10 (#$ . 10433) nil]) #@34 Launch PHPUnit on current class. (defalias 'phpunit-current-class #[nil "\301\302\303\304!\"!\207" [buffer-file-name phpunit-run s-chop-prefix phpunit-get-root-directory t] 4 (#$ . 10753) nil]) #@36 Launch PHPUnit on current project. (defalias 'phpunit-current-project #[nil "\300\301!\207" [phpunit-run ""] 2 (#$ . 10954) nil]) #@27 Launch PHPUnit for group. (defalias 'phpunit-group #[(use-last-group &optional group) "\304 \305!\306\307!\203#\n\310=\211\203 \203 \202\"\311\312\313 \"\314\315\316 \"!\210\317 \"*\207" [current-root-directory last-group use-last-group group phpunit-get-root-directory phpunit--get-last-group called-interactively-p interactive 1 completing-read "PHPUnit @group: " phpunit--listing-groups phpunit-run format "--group %s" phpunit--put-last-group] 5 (#$ . 11090) "p"]) (provide 'phpunit)