()
| 871 | |
| 872 | #[test] |
| 873 | fn inline_simple_variable() { |
| 874 | let php = r#"<?php |
| 875 | function foo() { |
| 876 | /*|*/$name = $user->getName(); |
| 877 | echo $name; |
| 878 | } |
| 879 | "#; |
| 880 | let content_without_marker = php.replace("/*|*/", ""); |
| 881 | let edits = run_inline(php).expect("action should be offered"); |
| 882 | let result = apply_edits(&content_without_marker, &edits); |
| 883 | assert!(!result.contains("$name = "), "assignment should be removed"); |
| 884 | assert!( |
| 885 | result.contains("echo $user->getName();"), |
| 886 | "read should be replaced with RHS: got:\n{}", |
| 887 | result |
| 888 | ); |
| 889 | } |
| 890 | |
| 891 | #[test] |
| 892 | fn inline_variable_multiple_reads() { |
nothing calls this directly
no test coverage detected