MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / test_function_call_references

Function test_function_call_references

src/references/tests.rs:330–351  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

328
329#[tokio::test]
330async fn test_function_call_references() {
331 let backend = Backend::new_test();
332 let uri = Url::parse("file:///test.php").unwrap();
333 let text = concat!(
334 "<?php\n", // L0
335 "function helper(): void {}\n", // L1
336 "function main(): void {\n", // L2
337 " helper();\n", // L3
338 " helper();\n", // L4
339 "}\n", // L5
340 );
341
342 open_file(&backend, &uri, text).await;
343
344 // Click on "helper" at line 3.
345 let locs = find_references(&backend, &uri, 3, 6, false).await;
346 assert!(
347 locs.len() >= 2,
348 "Expected at least 2 references to helper(), got {}",
349 locs.len()
350 );
351}
352
353#[tokio::test]
354async fn test_function_references_include_declaration() {

Callers

nothing calls this directly

Calls 3

find_referencesFunction · 0.85
open_fileFunction · 0.70
unwrapMethod · 0.45

Tested by

no test coverage detected