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

Function test_static_method_references

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

Source from the content-addressed store, hash-verified

274
275#[tokio::test]
276async fn test_static_method_references() {
277 let backend = Backend::new_test();
278 let uri = Url::parse("file:///test.php").unwrap();
279 let text = concat!(
280 "<?php\n", // L0
281 "class Factory {\n", // L1
282 " public static function create(): void {}\n", // L2
283 "}\n", // L3
284 "function demo(): void {\n", // L4
285 " Factory::create();\n", // L5
286 " Factory::create();\n", // L6
287 "}\n", // L7
288 );
289
290 open_file(&backend, &uri, text).await;
291
292 // Click on "create" at line 5.
293 let locs = find_references(&backend, &uri, 5, 15, false).await;
294 assert!(
295 locs.len() >= 2,
296 "Expected at least 2 references to create(), got {}",
297 locs.len()
298 );
299}
300
301#[tokio::test]
302async fn test_property_references() {

Callers

nothing calls this directly

Calls 3

find_referencesFunction · 0.85
open_fileFunction · 0.70
unwrapMethod · 0.45

Tested by

no test coverage detected