()
| 209 | |
| 210 | #[test] |
| 211 | fn for_loop_variables() { |
| 212 | let php = r#"<?php |
| 213 | function 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] |
| 227 | fn while_loop_variables() { |
nothing calls this directly
no test coverage detected