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

Function while_loop_variables

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

Source from the content-addressed store, hash-verified

225
226#[test]
227fn while_loop_variables() {
228 let php = r#"<?php
229function test() {
230 $i = 0;
231 while ($i < 10) {
232 echo $i;
233 $i++;
234 }
235}
236"#;
237 let scope_map = collect_from_function(php);
238
239 assert_eq!(count_kind(&scope_map, "$i", AccessKind::Write), 1);
240 assert_eq!(count_kind(&scope_map, "$i", AccessKind::ReadWrite), 1);
241 assert_eq!(count_kind(&scope_map, "$i", AccessKind::Read), 2); // condition + body
242}
243
244#[test]
245fn do_while_variables() {

Callers

nothing calls this directly

Calls 1

collect_from_functionFunction · 0.85

Tested by

no test coverage detected