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

Function for_loop_variables

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

Source from the content-addressed store, hash-verified

209
210#[test]
211fn for_loop_variables() {
212 let php = r#"<?php
213function test() {
214 for ($i = 0; $i < 10; $i++) {
215 echo $i;
216 }
217}
218"#;
219 let scope_map = collect_from_function(php);
220
221 assert_eq!(count_kind(&scope_map, "$i", AccessKind::Write), 1);
222 assert_eq!(count_kind(&scope_map, "$i", AccessKind::ReadWrite), 1); // $i++
223 assert_eq!(count_kind(&scope_map, "$i", AccessKind::Read), 2); // condition + body
224}
225
226#[test]
227fn while_loop_variables() {

Callers

nothing calls this directly

Calls 1

collect_from_functionFunction · 0.85

Tested by

no test coverage detected