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

Function do_while_variables

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

Source from the content-addressed store, hash-verified

243
244#[test]
245fn do_while_variables() {
246 let php = r#"<?php
247function test() {
248 $x = 0;
249 do {
250 $x++;
251 } while ($x < 10);
252}
253"#;
254 let scope_map = collect_from_function(php);
255
256 assert_eq!(count_kind(&scope_map, "$x", AccessKind::Write), 1);
257 assert_eq!(count_kind(&scope_map, "$x", AccessKind::ReadWrite), 1);
258 assert_eq!(count_kind(&scope_map, "$x", AccessKind::Read), 1); // condition
259}
260
261#[test]
262fn switch_case_variables() {

Callers

nothing calls this directly

Calls 1

collect_from_functionFunction · 0.85

Tested by

no test coverage detected