()
| 65 | /// define() with no second argument should have value = None. |
| 66 | #[tokio::test] |
| 67 | async fn test_define_no_value() { |
| 68 | let backend = create_test_backend(); |
| 69 | let uri = "file:///define_noval.php"; |
| 70 | // This is technically invalid PHP but stubs sometimes have it. |
| 71 | let content = "<?php\ndefine('NO_VAL');\n"; |
| 72 | backend.update_ast(uri, content); |
| 73 | |
| 74 | let dmap = backend.global_defines().read(); |
| 75 | // It may or may not appear in global_defines; if it does, value should be None. |
| 76 | if let Some(info) = dmap.get("NO_VAL") { |
| 77 | assert_eq!( |
| 78 | info.value, None, |
| 79 | "define with no second arg should have no value" |
| 80 | ); |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | // ─── DefineInfo value extraction from multi-constant stub files ───────────── |
| 85 |
nothing calls this directly
no test coverage detected