Skip to content

Commit

Permalink
Add indentation and highlighting test for closure
Browse files Browse the repository at this point in the history
  • Loading branch information
zonuexe committed Dec 9, 2019
1 parent 497aa1d commit f8ee6e4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/lang/function/closure.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

is_object(static function () {
// ###php-mode-test### ((indent 4))
});

is_object(static function (): void {
// ###php-mode-test### ((indent 4))
});
23 changes: 23 additions & 0 deletions tests/lang/function/closure.php.faces
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
;; -*- mode: emacs-lisp -*-
(("<?php" . php-php-tag)
("\n\n")
("is_object" . php-function-call)
("(")
("static" . php-keyword)
(" ")
("function" . php-keyword)
(" () {\n ")
("// " . font-lock-comment-delimiter-face)
("###php-mode-test### ((indent 4))\n" . font-lock-comment-face)
("});\n\n")
("is_object" . php-function-call)
("(")
("static" . php-keyword)
(" ")
("function" . php-keyword)
(" (): ")
("void" . font-lock-type-face)
(" {\n ")
("// " . font-lock-comment-delimiter-face)
("###php-mode-test### ((indent 4))\n" . font-lock-comment-face)
("});\n"))
1 change: 1 addition & 0 deletions tests/php-mode-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ Meant for `php-mode-test-issue-503'."
(with-php-mode-test ("doc-comment/inheritdoc.php" :faces t))
(with-php-mode-test ("lang/class/anonymous-class.php" :indent t :magic t :faces t))
(with-php-mode-test ("lang/function/calls.php" :faces t))
(with-php-mode-test ("lang/function/closure.php" :indent t :magic t :faces t))
(with-php-mode-test ("lang/try-cactch/multiple.php" :faces t))
(with-php-mode-test ("lang/types/cast.php" :faces t))
(with-php-mode-test ("lang/types/function.php" :faces t))
Expand Down

0 comments on commit f8ee6e4

Please sign in to comment.