()
| 86 | |
| 87 | #[test] |
| 88 | fn parameter_is_write() { |
| 89 | let php = r#"<?php |
| 90 | function test($a, $b) { |
| 91 | return $a + $b; |
| 92 | } |
| 93 | "#; |
| 94 | let scope_map = collect_from_function(php); |
| 95 | |
| 96 | // Parameters are writes. |
| 97 | assert_eq!(count_kind(&scope_map, "$a", AccessKind::Write), 1); |
| 98 | assert_eq!(count_kind(&scope_map, "$b", AccessKind::Write), 1); |
| 99 | // Return reads both. |
| 100 | assert_eq!(count_kind(&scope_map, "$a", AccessKind::Read), 1); |
| 101 | assert_eq!(count_kind(&scope_map, "$b", AccessKind::Read), 1); |
| 102 | } |
| 103 | |
| 104 | #[test] |
| 105 | fn multiple_assignments() { |
nothing calls this directly
no test coverage detected