Skip to content

Commit db2179d

Browse files
authored
Merge pull request #449 from zonuexe/test/php-mode-debug
Add php-mode-debug test
2 parents fb8e748 + f3c53ac commit db2179d

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

Diff for: php-mode-test.el

+12
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,18 @@ style from Drupal."
928928
"Test highlighting of type hints and return types."
929929
(with-php-mode-test ("type-hints.php" :faces t)))
930930

931+
(ert-deftest php-mode-debug-test ()
932+
"Test running php-mode-debug and php-mode-debug--buffer."
933+
(with-temp-buffer
934+
(php-mode)
935+
(php-mode-debug)
936+
(should (string= (buffer-name) "*PHP Mode DEBUG*"))
937+
(php-mode-debug--buffer 'top)
938+
(search-forward "--- PHP-MODE DEBUG BEGIN ---")
939+
(search-forward "--- PHP-MODE DEBUG END ---"))
940+
(with-current-buffer (php-mode-debug--buffer 'init)
941+
(should (eq 0 (- (point-max) (point-min))))))
942+
931943
(ert-deftest php-project-root ()
932944
(should (string= (abbreviate-file-name default-directory)
933945
(php-project-get-root-dir))))

Diff for: php-mode.el

+3-2
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,9 @@ In that case set to `NIL'."
396396
(defun php-mode-version ()
397397
"Display string describing the version of PHP Mode."
398398
(interactive)
399-
(message "PHP Mode %s of %s"
400-
php-mode-version-number php-mode-modified))
399+
(funcall
400+
(if (called-interactively-p 'interactive) #'message #'format)
401+
"PHP Mode %s of %s" php-mode-version-number php-mode-modified))
401402

402403
;;;###autoload
403404
(define-obsolete-variable-alias 'php-available-project-root-files 'php-project-available-root-files "1.19.0")

0 commit comments

Comments
 (0)