()
| 1144 | |
| 1145 | #[test] |
| 1146 | fn symbol_info_function_params() { |
| 1147 | let content = concat!( |
| 1148 | "<?php\n", |
| 1149 | "/**\n", |
| 1150 | " * @\n", |
| 1151 | " */\n", |
| 1152 | "function greet(string $name, int $age): string {\n", |
| 1153 | " return '';\n", |
| 1154 | "}\n", |
| 1155 | ); |
| 1156 | let pos = Position { |
| 1157 | line: 2, |
| 1158 | character: 4, |
| 1159 | }; |
| 1160 | let info = extract_symbol_info(content, pos); |
| 1161 | |
| 1162 | assert_eq!(info.params.len(), 2); |
| 1163 | assert_eq!( |
| 1164 | info.params[0], |
| 1165 | (Some(PhpType::parse("string")), "$name".to_string()) |
| 1166 | ); |
| 1167 | assert_eq!( |
| 1168 | info.params[1], |
| 1169 | (Some(PhpType::parse("int")), "$age".to_string()) |
| 1170 | ); |
| 1171 | assert_eq!(info.return_type, Some(PhpType::parse("string"))); |
| 1172 | } |
| 1173 | |
| 1174 | #[test] |
| 1175 | fn symbol_info_method_no_type_hints() { |
nothing calls this directly
no test coverage detected