Skip to content

Commit

Permalink
Bump version.
Browse files Browse the repository at this point in the history
Save buffers when running tests.
Don't use compilation-directory, use phpunit-run-directory.
Change back to phpunit-run-directory when retesting.
Assume anything under "test/" or "tests/" is testable.
  • Loading branch information
ieure committed Jan 31, 2009
1 parent a4fae28 commit aead2e0
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions phpunit.el
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
;; If you customize 'phpunit-testable-list, a corresponding test file
;; will be searched for when you open a .php file.

(defconst phpunit-version-number "0.8.5"
(defconst phpunit-version-number "0.8.6"
"PHPUnit Mode version number.")

(require 'compile)
Expand Down Expand Up @@ -160,16 +160,20 @@ Run `phpunit-setup-hook'."
(list
(let ((command phpunit-command))
(phpunit-read-command command))))
(save-some-buffers t)
(unless (equal command (eval phpunit-command))
(setq phpunit-command command))
(setq-default compilation-directory default-directory)
(setq-default phpunit-run-directory default-directory)
(compilation-start command 'phpunit-run-mode))

;;;###autoload
(defun phpunit-run-test-or-retest ()
"Re-run the last PHPUnit test (if any), or start a new test."
(interactive)
(or (and phpunit-history (phpunit-run-test (car phpunit-history)))
(or (and phpunit-history
(let ((default-directory (or phpunit-run-directory
default-directory)))
(phpunit-run-test (car phpunit-history))))
(call-interactively 'phpunit-run-test)))

;;;###autoload
Expand Down Expand Up @@ -240,6 +244,9 @@ Returns `nil' if FILE doesn't match any patterns in `phpunit-testable-list'"

(add-hook 'php-mode-hook
'(lambda ()
(and (phpunit-testablep) (phpunit-minor-mode t))))
(and (or (phpunit-testablep)
(and (buffer-file-name)
(string-match "/test\\(s\\)?/" (buffer-file-name))))
(phpunit-minor-mode t))))

(provide 'phpunit)

0 comments on commit aead2e0

Please sign in to comment.