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

Function test_define_no_value

tests/integration/definition_constants.rs:67–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65/// define() with no second argument should have value = None.
66#[tokio::test]
67async 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

Callers

nothing calls this directly

Calls 4

create_test_backendFunction · 0.85
update_astMethod · 0.80
global_definesMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected