emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/phps-mode 076c1205bc 4/5: Added unit test for trait dec


From: Christian Johansson
Subject: [elpa] externals/phps-mode 076c1205bc 4/5: Added unit test for trait declaration imenu item
Date: Sun, 5 Mar 2023 03:43:33 -0500 (EST)

branch: externals/phps-mode
commit 076c1205bcff23992db90213824731605774fe5d
Author: christian <christian@cvj.se>
Commit: christian <christian@cvj.se>

    Added unit test for trait declaration imenu item
---
 test/phps-mode-test-ast.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/test/phps-mode-test-ast.el b/test/phps-mode-test-ast.el
index e6655b8156..880e77841f 100644
--- a/test/phps-mode-test-ast.el
+++ b/test/phps-mode-test-ast.el
@@ -131,6 +131,12 @@
   ;;  '(((159 170) 1) ((208 220) 1) ((371 384) 0) ((848 862) 5) ((900 911) 1) 
((1000 1011) 1))
   ;;  '(("abc")))
 
+  (phps-mode-test-ast--should-bookkeep
+   "<?php\ntrait Foo\n{\n    public const CONSTANT = 1;\n}\n\nclass Bar\n{\n   
 use Foo;\n}\n\nvar_dump(Bar::CONSTANT); // 1\nvar_dump(Foo::CONSTANT); // 
Error"
+   "PHP 8.2 trait constants"
+   nil
+   '(("trait Foo" ("declaration" . 13) ("CONSTANT" . 36)) ("class Bar" 
("declaration" . 59))))
+
   (phps-mode-test-ast--should-bookkeep
    "<?php\n\n$var = 'abc';\n\nif ($var2) {\n    echo 'This never 
happens';\n}\nif ($var) {\n    echo 'This happens';\n}"
    "Bookkeeping in root level variable assignments #1"
@@ -356,7 +362,7 @@
    "<?php\ntrait MyTrait {\n    private $var = 'abc';\n    public function 
sayHello() {\n        if ($this->var) {\n            echo 'Hit';\n        }\n   
 }\n}\n"
    "A basic trait class"
    '(((35 39) 1) ((94 99) 2) ((101 104) 1))
-   '(("trait MyTrait" ("declaration") ("$var" . 35) ("function sayHello" 
("declaration" . 69)))))
+   '(("trait MyTrait" ("declaration" . 13) ("$var" . 35) ("function sayHello" 
("declaration" . 69)))))
 
   (phps-mode-test-ast--should-bookkeep
    "<?php\nclass Person {\n    public function __construct(\n        private 
string $name,\n        private int $age,\n        public $address\n    ) {}\n}"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]