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

Function include_inside_method_body

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

Source from the content-addressed store, hash-verified

259
260#[test]
261fn include_inside_method_body() {
262 let dir = tempfile::tempdir().unwrap();
263 let target = dir.path().join("routes.php");
264 fs::write(&target, "<?php // routes").unwrap();
265
266 let main_content = format!(
267 "<?php\nclass App {{\n public function boot(): void {{\n require_once '{}';\n }}\n}}\n",
268 target.to_string_lossy()
269 );
270 let main_uri = format!("file://{}", dir.path().join("main.php").to_string_lossy());
271
272 let backend = create_test_backend();
273 let links = get_document_links(&backend, &main_uri, &main_content);
274
275 assert_eq!(
276 links.len(),
277 1,
278 "Expected include inside method body, got: {:?}",
279 link_targets(&links)
280 );
281}
282
283#[test]
284fn include_inside_if_statement() {

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