[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phpinspect 8caf967b57 029/126: Add test for resolve-typ
From: |
ELPA Syncer |
Subject: |
[elpa] externals/phpinspect 8caf967b57 029/126: Add test for resolve-type-from-context with preceding bareword |
Date: |
Sat, 12 Aug 2023 00:58:37 -0400 (EDT) |
branch: externals/phpinspect
commit 8caf967b57043dbeee62b961ca2e63af119b1d15
Author: Hugo Thunnissen <devel@hugot.nl>
Commit: Hugo Thunnissen <devel@hugot.nl>
Add test for resolve-type-from-context with preceding bareword
---
test/phpinspect-test.el | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/test/phpinspect-test.el b/test/phpinspect-test.el
index da8605220d..2e43bd0d85 100644
--- a/test/phpinspect-test.el
+++ b/test/phpinspect-test.el
@@ -394,6 +394,34 @@ class Thing
(phpinspect--make-type-resolver-for-resolvecontext
context))))))
+(ert-deftest
phpinspect-resolve-type-from-context-static-method-with-preceding-words ()
+ (let* ((php-code "
+class Thing
+{
+ static function doThing(\\DateTime $moment, Thing $thing, $other): static
+ {
+ return $this;
+ }
+
+ function doStuff()
+ {
+ if (true) {
+ return self::doThing()->")
+ (tokens (phpinspect-parse-string php-code))
+ (index (phpinspect--index-tokens tokens))
+ (phpinspect-project-root-function (lambda () "phpinspect-test"))
+ (phpinspect-eldoc-word-width 100)
+ (context (phpinspect--get-resolvecontext tokens)))
+ (phpinspect-purge-cache)
+ (phpinspect-cache-project-class
+ (phpinspect-project-root)
+ (cdar (alist-get 'classes (cdr index))))
+
+ (should (string= "\\Thing"
+ (phpinspect-resolve-type-from-context
+ context
+ (phpinspect--make-type-resolver-for-resolvecontext
+ context))))))
(provide 'phpinspect-test)
;;; phpinspect-test.el ends here
- [elpa] externals/phpinspect ce995f2bc4 101/126: Remove unused variables, (continued)
- [elpa] externals/phpinspect ce995f2bc4 101/126: Remove unused variables, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect f2ece03f2a 109/126: Add factilities to filter logs from different modules, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 59a098a4cd 015/126: Add note about parser cache to defhandler + add config example, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 4430aaccb9 011/126: Rework parser code, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 0350069e34 005/126: Fix native (built-in) type names, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect f8689ac9df 018/126: Return parser function in stead of just the symbol, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 825a3de2c4 017/126: Add indexation command to mode docstring + add install to readme, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 1e4e865c9b 021/126: Add variables nested in (function or other) blocks to candidates, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 2b85271b2b 030/126: Test + fix get-last-statement-in-token for static attribute references, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect a60dba5f11 031/126: WIP: new struct to represent types, and string comparison optimization with obarray, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 8caf967b57 029/126: Add test for resolve-type-from-context with preceding bareword,
ELPA Syncer <=
- [elpa] externals/phpinspect 341afd42da 037/126: WIP: Index types in the background using collaborative threading., ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 98e88d45ac 034/126: WIP: Fix find-class-file, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 350850c07a 052/126: Fix phpinspect-index-static-methods test, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 224bbd7916 057/126: Implement array member type inference, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 9882ed2c60 061/126: Test/fix type inference of objects in nested arrays, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 47335f3450 064/126: Refactor phpinspect--project to phpinspect-project, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 1b1cf45638 054/126: Fix bug in extended classes' method merging + add some tests, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 153ff71fcf 048/126: WIP: Implement psr0 and psr4 autoload strategies, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect e65b268cea 053/126: Implement @method annotation indexation, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect ae3acbdbe1 056/126: Disable auto-reindexing by default, ELPA Syncer, 2023/08/12