MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / switch_case_variables

Function switch_case_variables

src/scope_collector/tests.rs:262–283  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

260
261#[test]
262fn switch_case_variables() {
263 let php = r#"<?php
264function test($val) {
265 switch ($val) {
266 case 1:
267 $result = "one";
268 break;
269 case 2:
270 $result = "two";
271 break;
272 default:
273 $result = "other";
274 }
275 echo $result;
276}
277"#;
278 let scope_map = collect_from_function(php);
279
280 assert_eq!(count_kind(&scope_map, "$result", AccessKind::Write), 3);
281 assert_eq!(count_kind(&scope_map, "$result", AccessKind::Read), 1);
282 assert_eq!(count_kind(&scope_map, "$val", AccessKind::Read), 1);
283}
284
285#[test]
286fn try_catch_finally() {

Callers

nothing calls this directly

Calls 1

collect_from_functionFunction · 0.85

Tested by

no test coverage detected