branch: externals/phps-mode
commit 35c9b0fd1cbb3f372f03f650ba21ffa1e47d4eae
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>
Imenu generated correctly for one case
---
test/phps-mode-test-lex-analyzer.el | 5 +++++
test/phps-mode-test-parser.el | 8 ++++----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/test/phps-mode-test-lex-analyzer.el
b/test/phps-mode-test-lex-analyzer.el
index 396a026e2c..c062a2ecb4 100644
--- a/test/phps-mode-test-lex-analyzer.el
+++ b/test/phps-mode-test-lex-analyzer.el
@@ -1239,6 +1239,11 @@
"Imenu in interface class with arguments in one method"
(should (equal (phps-mode-lex-analyzer--get-imenu) '(("myInterface"
("myFunction1" . 44) ("myFunction2" . 72))))))
+ (phps-mode-test--with-buffer
+ "<?php\n\nnamespace MyNamespace;\n\nfunction aFunction() {\n /**\n *
With some contents\n */\n}\n\nclass MyClass\n{\n\n /**\n *\n
*/\n public function __construct()\n {\n if ($test) {\n }\n
}\n\n /**\n *\n */\n public function myFunction1()\n {\n
$this->addMessage(\"My random {$message} here\" . ($random > 1 ? \"A\" :
\"\") . \" was here.\");\n }\n \n /**\n *\n */\n public
function myFunction2()\n [...]
+ "Imenu with double quoted string with variable inside it and concatenated
string"
+ (should (equal (phps-mode-lex-analyzer--get-imenu) '(("MyNamespace"
("aFunction" . 41) ("MyClass" ("__construct" . 160) ("myFunction1" . 261)
("myFunction2" . 433) ("myFunction3" . 513) ("myFunction4" . 583)))))))
+
)
(defun phps-mode-test-lex-analyzer--get-moved-imenu ()
diff --git a/test/phps-mode-test-parser.el b/test/phps-mode-test-parser.el
index 827ed3497d..0ebc4ccaa7 100644
--- a/test/phps-mode-test-parser.el
+++ b/test/phps-mode-test-parser.el
@@ -476,7 +476,7 @@
(progn
(dolist (grandchild grandchildren)
(push
- `(,(plist-get grandchild 'name) .
,(plist-get grandchild 'start))
+ `(,(plist-get grandchild 'name) .
,(plist-get grandchild 'index))
subparent))
(push
(append
@@ -484,7 +484,7 @@
(reverse subparent))
parent))
(push
- `(,(plist-get child 'name) . ,(plist-get child
'start))
+ `(,(plist-get child 'name) . ,(plist-get child
'index))
parent)))
)
(push
@@ -493,7 +493,7 @@
(reverse parent))
imenu-index))
(push
- `(,(plist-get item 'name) . ,(plist-get item 'start))
+ `(,(plist-get item 'name) . ,(plist-get item 'index))
imenu-index))))
(message "imenu-index:\n%S\n" imenu-index)
@@ -501,7 +501,7 @@
(should
(equal
imenu-index
- '(("MyNamespace" ("aFunction" . 53) ("MyClass" ("__construct" .
178) ("myFunction1" . 279) ("myFunction2" . 451) ("myFunction3" . 531)
("myFunction4" . 601))))))
+ '(("MyNamespace" ("aFunction" . 41) ("MyClass" ("__construct" .
160) ("myFunction1" . 261) ("myFunction2" . 433) ("myFunction3" . 513)
("myFunction4" . 583))))))
)))))
(message "\n-- Ran tests for parser translation. --"))