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

Function require_relative_path

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

Source from the content-addressed store, hash-verified

189
190#[test]
191fn require_relative_path() {
192 let dir = tempfile::tempdir().unwrap();
193 let target_file = dir.path().join("helpers.php");
194 fs::write(&target_file, "<?php // helpers").unwrap();
195
196 // A relative path should resolve relative to the file's directory.
197 let main_content = "<?php\nrequire_once 'helpers.php';\n";
198 let main_uri = format!("file://{}", dir.path().join("main.php").to_string_lossy());
199
200 let backend = create_test_backend();
201 let links = get_document_links(&backend, &main_uri, main_content);
202
203 assert_eq!(
204 links.len(),
205 1,
206 "Expected one relative path link, got: {:?}",
207 link_targets(&links)
208 );
209}
210
211#[test]
212fn multiple_includes_in_one_file() {

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