()
| 225 | |
| 226 | #[test] |
| 227 | fn while_loop_variables() { |
| 228 | let php = r#"<?php |
| 229 | function 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] |
| 245 | fn do_while_variables() { |
nothing calls this directly
no test coverage detected