()
| 407 | |
| 408 | #[tokio::test] |
| 409 | async 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 |
nothing calls this directly
no test coverage detected