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

Function rename_static_method

src/rename/tests.rs:409–438  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

407
408#[tokio::test]
409async fn rename_static_method() {
410 let backend = Backend::new_test();
411 let uri = Url::parse("file:///test.php").unwrap();
412 let text = concat!(
413 "<?php\n",
414 "class Factory {\n",
415 " public static function create(): self { return new self(); }\n",
416 "}\n",
417 "function demo(): void {\n",
418 " Factory::create();\n",
419 " Factory::create();\n",
420 "}\n",
421 );
422
423 open_file(&backend, &uri, text).await;
424
425 let edit = rename(&backend, &uri, 5, 14, "build").await;
426 assert!(edit.is_some());
427
428 let file_edits = edits_for_uri(&edit.unwrap(), &uri);
429 assert!(
430 file_edits.len() >= 3,
431 "Expected at least 3 edits for create, got {}",
432 file_edits.len()
433 );
434
435 for te in &file_edits {
436 assert_eq!(te.new_text, "build");
437 }
438}
439
440// ─── Property Rename ────────────────────────────────────────────────────────
441

Callers

nothing calls this directly

Calls 4

renameFunction · 0.85
edits_for_uriFunction · 0.85
open_fileFunction · 0.70
unwrapMethod · 0.45

Tested by

no test coverage detected