()
| 948 | |
| 949 | #[test] |
| 950 | fn class_method_body() { |
| 951 | let content = r#"<?php |
| 952 | class Greeter { |
| 953 | public function greet(string $name): string { |
| 954 | return "Hello, " . $name; |
| 955 | } |
| 956 | } |
| 957 | "#; |
| 958 | // Position cursor on `$name` in the return statement (line 3, char 29). |
| 959 | let results = selection_ranges(content, &[Position::new(3, 29)]); |
| 960 | assert_eq!(results.len(), 1); |
| 961 | let ranges = flatten(&results[0]); |
| 962 | |
| 963 | // Should have levels: variable → expression → return → block → method → class body → class → file. |
| 964 | assert!( |
| 965 | ranges.len() >= 4, |
| 966 | "Expected at least 4 selection range levels, got {}", |
| 967 | ranges.len() |
| 968 | ); |
| 969 | } |
| 970 | |
| 971 | #[test] |
| 972 | fn multiple_positions() { |
nothing calls this directly
no test coverage detected