Skip to content

Commit a9fec82

Browse files
committed
Add indentation and highlighting test for closure
1 parent 50e87f8 commit a9fec82

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

tests/lang/function/closure.php

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
is_object(static function () {
4+
// ###php-mode-test### ((indent 4))
5+
});
6+
7+
is_object(static function (): void {
8+
// ###php-mode-test### ((indent 4))
9+
});

tests/lang/function/closure.php.faces

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
;; -*- mode: emacs-lisp -*-
2+
(("<?php" . php-php-tag)
3+
("\n\n")
4+
("is_object" . php-function-call)
5+
("(")
6+
("static" . php-keyword)
7+
(" ")
8+
("function" . php-keyword)
9+
(" () {\n ")
10+
("// " . font-lock-comment-delimiter-face)
11+
("###php-mode-test### ((indent 4))\n" . font-lock-comment-face)
12+
("});\n\n")
13+
("is_object" . php-function-call)
14+
("(")
15+
("static" . php-keyword)
16+
(" ")
17+
("function" . php-keyword)
18+
(" (): ")
19+
("void" . font-lock-type-face)
20+
(" {\n ")
21+
("// " . font-lock-comment-delimiter-face)
22+
("###php-mode-test### ((indent 4))\n" . font-lock-comment-face)
23+
("});\n"))

tests/php-mode-test.el

+1
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ Meant for `php-mode-test-issue-503'."
683683
(with-php-mode-test ("doc-comment/inheritdoc.php" :faces t))
684684
(with-php-mode-test ("lang/class/anonymous-class.php" :indent t :magic t :faces t))
685685
(with-php-mode-test ("lang/function/calls.php" :faces t))
686+
(with-php-mode-test ("lang/function/closure.php" :indent t :magic t :faces t))
686687
(with-php-mode-test ("lang/try-cactch/multiple.php" :faces t))
687688
(with-php-mode-test ("lang/types/cast.php" :faces t))
688689
(with-php-mode-test ("lang/types/function.php" :faces t))

0 commit comments

Comments
 (0)