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

Function require_string_literal

tests/integration/document_links.rs:74–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

72
73#[test]
74fn require_string_literal() {
75 let dir = tempfile::tempdir().unwrap();
76 let target_file = dir.path().join("helpers.php");
77 fs::write(&target_file, "<?php // helpers").unwrap();
78
79 let main_content = format!("<?php\nrequire '{}';\n", target_file.to_string_lossy());
80 let main_uri = format!("file://{}", dir.path().join("main.php").to_string_lossy());
81
82 let backend = create_test_backend();
83 let links = get_document_links(&backend, &main_uri, &main_content);
84
85 assert_eq!(
86 links.len(),
87 1,
88 "Expected one require link, got: {:?}",
89 link_targets(&links)
90 );
91}
92
93#[test]
94fn include_once_string_literal() {

Callers

nothing calls this directly

Calls 3

create_test_backendFunction · 0.85
get_document_linksFunction · 0.85
unwrapMethod · 0.45

Tested by

no test coverage detected