Skip to content

Commit

Permalink
Merge pull request #24 from nlamirault/develop
Browse files Browse the repository at this point in the history
Release 0.10.0
  • Loading branch information
nlamirault committed Aug 7, 2016
2 parents 7b2a811 + a30524d commit 77686cc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# phpunit.el ChangeLog

## Version 0.10.0 (08/07/2016)

- #PR23: Better regexp using rx (Thanks zonuexe)
- #PR22: Simplify phpunit-current-class (Thanks zonuexe)
- #PR21: Fix for Emacs 25.1 (Thanks zonuexe)

## Version 0.9.0 (05/31/2016)

- #PR19: Some problem fixes (Tramp, phpunit-get-root-directory,
Expand Down
22 changes: 17 additions & 5 deletions phpunit.el
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
;; Eric Hansen <hansen.c.eric@gmail.com>
;;
;; URL: https://github.com/nlamirault/phpunit.el
;; Version: 0.9.0
;; Version: 0.10.0
;; Keywords: php, tests, phpunit

;; Package-Requires: ((s "1.9.0") (f "0.16.0") (pkg-info "0.5") (cl-lib "0.5") (emacs "24.3"))
Expand Down Expand Up @@ -44,6 +44,8 @@
(require 'cl-lib)
(require 's)
(require 'f)
(eval-when-compile
(require 'rx))

(defgroup phpunit nil
"PHPUnit utility"
Expand Down Expand Up @@ -85,7 +87,16 @@
:group 'phpunit)

(defconst php-beginning-of-defun-regexp
"^\\s-*\\(?:\\(?:abstract\\|final\\|private\\|protected\\|public\\|static\\)\\s-+\\)*function\\s-+&?\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*("
(eval-when-compile
(rx line-start
(* (syntax whitespace))
(* (or "abstract" "final" "private" "protected" "public" "static"))
"function"
(+ (syntax whitespace))
(? "&")
(group (+ (or (syntax word) (syntax symbol))))
(* (syntax whitespace))
"("))
"Regular expression for a PHP function.")

(defconst php-beginning-of-class
Expand Down Expand Up @@ -119,6 +130,9 @@
;; "vendor/bin/phpunit"))
(unless phpunit-executable
(setq phpunit-executable phpunit-program))
(when (file-remote-p phpunit-executable)
(setq phpunit-executable
(tramp-file-name-localname (tramp-dissect-file-name phpunit-executable))))
(s-concat phpunit-executable
(if phpunit-configuration-file
(s-concat " -c " phpunit-configuration-file)
Expand Down Expand Up @@ -206,9 +220,7 @@
(defun phpunit-current-class ()
"Launch PHPUnit on current class."
(interactive)
(let ((args (s-concat " --filter '(?<!" php-labelchar-regexp ")" (phpunit-get-current-class) "'")))
(phpunit-run args)))

(phpunit-run (s-chop-prefix (phpunit-get-root-directory) buffer-file-name)))

;;;###autoload
(defun phpunit-current-project ()
Expand Down
2 changes: 1 addition & 1 deletion test/phpunit-version-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
;;(message "PHPUnit.el : %s" lib-version)
(message "PHPUnit.el Cask version: %s" cask-version)
;;(should (string= version (phpunit-mode-library-version)))))
(should (string= "0.9.0" cask-version))))
(should (string= "0.10.0" cask-version))))



Expand Down

0 comments on commit 77686cc

Please sign in to comment.