()
| 137 | |
| 138 | #[tokio::test] |
| 139 | async fn rename_variable_without_dollar_prefix() { |
| 140 | let backend = Backend::new_test(); |
| 141 | let uri = Url::parse("file:///test.php").unwrap(); |
| 142 | let text = concat!( |
| 143 | "<?php\n", |
| 144 | "function demo(): void {\n", |
| 145 | " $x = 1;\n", |
| 146 | " echo $x;\n", |
| 147 | "}\n", |
| 148 | ); |
| 149 | |
| 150 | open_file(&backend, &uri, text).await; |
| 151 | |
| 152 | // User provides new name without `$` — the handler should add it. |
| 153 | let edit = rename(&backend, &uri, 2, 5, "y").await; |
| 154 | assert!(edit.is_some()); |
| 155 | |
| 156 | let file_edits = edits_for_uri(&edit.unwrap(), &uri); |
| 157 | for te in &file_edits { |
| 158 | assert_eq!(te.new_text, "$y"); |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | #[tokio::test] |
| 163 | async fn prepare_rename_variable() { |
nothing calls this directly
no test coverage detected