Skip to content

Commit

Permalink
Add test for lang/errorcontrol.php
Browse files Browse the repository at this point in the history
  • Loading branch information
zonuexe committed May 15, 2019
1 parent 8a43710 commit c861fca
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
4 changes: 4 additions & 0 deletions php-mode-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -984,4 +984,8 @@ Meant for `php-mode-test-issue-503'."
"Test highlighting arrow funcsion (short closure syntax) added in PHP 7.4."
(with-php-mode-test ("7.4/arrow-function.php" :faces t)))

(ert-deftest php-mode-test-lang ()
"Test highlighting for language constructs."
(with-php-mode-test ("lang/errorcontrol.php" :faces t)))

;;; php-mode-test.el ends here
9 changes: 9 additions & 0 deletions tests/lang/errorcontrol.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

new stdClass;
@new stdClass;
echo @a.@b;
echo @a;
echo @$a;

@fopen('php://memory', 'rw');
33 changes: 33 additions & 0 deletions tests/lang/errorcontrol.php.faces
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
;; -*- mode: emacs-lisp -*-
(("<?php" . php-php-tag)
("\n\n")
("new" . php-keyword)
(" ")
("stdClass" . font-lock-type-face)
(";\n")
("@new" . php-keyword)
(" ")
("stdClass" . font-lock-type-face)
(";\n")
("echo" . php-keyword)
(" ")
("@" . php-errorcontrol-op)
("a.")
("@" . php-errorcontrol-op)
("b;\n")
("echo" . php-keyword)
(" ")
("@" . php-errorcontrol-op)
("a;\n")
("echo" . php-keyword)
(" ")
("@" . php-errorcontrol-op)
("$" . php-variable-sigil)
("a" . php-variable-name)
(";\n\n")
("@" . php-errorcontrol-op)
("fopen(")
("'php://memory'" . php-string)
(", ")
("'rw'" . php-string)
(");\n"))

0 comments on commit c861fca

Please sign in to comment.