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

Function simple_assignment_and_read

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

Source from the content-addressed store, hash-verified

71
72#[test]
73fn simple_assignment_and_read() {
74 let php = r#"<?php
75function test() {
76 $x = 1;
77 echo $x;
78}
79"#;
80 let scope_map = collect_from_function(php);
81
82 assert_eq!(count_kind(&scope_map, "$x", AccessKind::Write), 1);
83 assert_eq!(count_kind(&scope_map, "$x", AccessKind::Read), 1);
84 assert_eq!(scope_map.accesses.len(), 2);
85}
86
87#[test]
88fn parameter_is_write() {

Callers

nothing calls this directly

Calls 1

collect_from_functionFunction · 0.85

Tested by

no test coverage detected