Skip to content

Commit da84231

Browse files
committed
Modify test for variables
1 parent c6937e1 commit da84231

File tree

2 files changed

+51
-6
lines changed

2 files changed

+51
-6
lines changed

tests/variables.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
<?php
22

33
// Test highlighting of variables with the variable-name-face
4+
$_;
45
$regularVariable;
56
$$variableVariable;
7+
$漢字;
8+
$snake_case;
9+
$abc123xyz;
10+
$def_456_ghi;
11+
${'var'};
12+
${"var"};
13+
${$var};
14+
${'v' . 'ar'};
15+
$a{1};
16+
$a{'a'};
617
MyClass::$staticVariable;
718
$object->memberVariable;
819
$object->funCall();

tests/variables.php.faces

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,60 @@
11
;; -*- mode: emacs-lisp -*-
22
(("<?php" . php-php-tag)
3-
("\n\n" . nil)
3+
("\n\n")
44
("// " . font-lock-comment-delimiter-face)
55
("Test highlighting of variables with the variable-name-face\n" . font-lock-comment-face)
66
("$" . php-variable-sigil)
7+
("_" . php-variable-name)
8+
(";\n")
9+
("$" . php-variable-sigil)
710
("regularVariable" . php-variable-name)
8-
(";\n" . nil)
11+
(";\n")
912
("$$" . php-variable-sigil)
1013
("variableVariable" . php-variable-name)
11-
(";\n" . nil)
14+
(";\n")
15+
("$" . php-variable-sigil)
16+
("漢字" . php-variable-name)
17+
(";\n")
18+
("$" . php-variable-sigil)
19+
("snake_case" . php-variable-name)
20+
(";\n")
21+
("$" . php-variable-sigil)
22+
("abc123xyz" . php-variable-name)
23+
(";\n")
24+
("$" . php-variable-sigil)
25+
("def_456_ghi" . php-variable-name)
26+
(";\n${")
27+
("'var'" . php-string)
28+
("};\n${")
29+
("\"var\"" . php-string)
30+
("};\n${")
31+
("$" . php-variable-sigil)
32+
("var" . php-variable-name)
33+
("};\n${")
34+
("'v'" . php-string)
35+
(" . ")
36+
("'ar'" . php-string)
37+
("};\n")
38+
("$" . php-variable-sigil)
39+
("a" . php-variable-name)
40+
("{1};\n")
41+
("$" . php-variable-sigil)
42+
("a" . php-variable-name)
43+
("{")
44+
("'a'" . php-string)
45+
("};\n")
1246
("MyClass" . php-constant)
1347
("::" . php-paamayim-nekudotayim)
1448
("$" . php-variable-sigil)
1549
("staticVariable" . php-variable-name)
16-
(";\n" . nil)
50+
(";\n")
1751
("$" . php-variable-sigil)
1852
("object" . php-variable-name)
1953
("->" . php-object-op)
2054
("memberVariable" . php-property-name)
21-
(";\n" . nil)
55+
(";\n")
2256
("$" . php-variable-sigil)
2357
("object" . php-variable-name)
2458
("->" . php-object-op)
2559
("funCall" . php-method-call)
26-
("();\n" . nil))
60+
("();\n"))

0 commit comments

Comments
 (0)